equal
deleted
inserted
replaced
579 def ajax_error_handler(self, req, ex): |
579 def ajax_error_handler(self, req, ex): |
580 req.set_header('content-type', 'application/json') |
580 req.set_header('content-type', 'application/json') |
581 status = httplib.INTERNAL_SERVER_ERROR |
581 status = httplib.INTERNAL_SERVER_ERROR |
582 if isinstance(ex, PublishException) and ex.status is not None: |
582 if isinstance(ex, PublishException) and ex.status is not None: |
583 status = ex.status |
583 status = ex.status |
584 req.status_out = status |
584 if req.status_out < 400: |
|
585 # don't overwrite it if it's already set |
|
586 req.status_out = status |
585 json_dumper = getattr(ex, 'dumps', lambda : unicode(ex)) |
587 json_dumper = getattr(ex, 'dumps', lambda : unicode(ex)) |
586 return json_dumper() |
588 return json_dumper() |
587 |
589 |
588 # special case handling |
590 # special case handling |
589 |
591 |