Swallow 500 errors

pull/26/head
Sheng 2018-08-28 21:15:57 +08:00
parent ad12876b0c
commit 49226fbf23
1 changed files with 7 additions and 5 deletions

View File

@ -74,9 +74,11 @@ class IndexHandler(MixinHandler, tornado.web.RequestHandler):
self.result = dict(id=None, status=None, encoding=None)
def write_error(self, status_code, **kwargs):
if self.settings.get('serve_traceback') or status_code == 500 or \
not swallow_http_errors:
if not swallow_http_errors:
super(MixinHandler, self).write_error(status_code, **kwargs)
else:
if status_code == 500:
self._reason = 'Internal Server Error'
else:
exc_info = kwargs.get('exc_info')
if exc_info: