Commit 49226fbf by Sheng

Swallow 500 errors

parent ad12876b
...@@ -74,10 +74,12 @@ class IndexHandler(MixinHandler, tornado.web.RequestHandler): ...@@ -74,10 +74,12 @@ class IndexHandler(MixinHandler, tornado.web.RequestHandler):
self.result = dict(id=None, status=None, encoding=None) self.result = dict(id=None, status=None, encoding=None)
def write_error(self, status_code, **kwargs): def write_error(self, status_code, **kwargs):
if self.settings.get('serve_traceback') or status_code == 500 or \ if not swallow_http_errors:
not swallow_http_errors:
super(MixinHandler, self).write_error(status_code, **kwargs) super(MixinHandler, self).write_error(status_code, **kwargs)
else: else:
if status_code == 500:
self._reason = 'Internal Server Error'
else:
exc_info = kwargs.get('exc_info') exc_info = kwargs.get('exc_info')
if exc_info: if exc_info:
self._reason = exc_info[1].log_message self._reason = exc_info[1].log_message
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment