--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/404.html Sun Jun 19 00:04:48 2016 +0800
+{% extends "base.html" %}
+{% block title %}{{ message }}{% end %}
+ <div class="uk-container uk-container-center uk-margin-large-top">
+ <pre>{{ debug_message }}</pre>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/500.html Sun Jun 19 00:04:48 2016 +0800
+{% extends "base.html" %}
+{% block title %}{{ message }}{% end %}
+ <div class="uk-container uk-container-center uk-margin-large-top">
+ <pre>{{ debug_message }}</pre>
--- a/viewer.py Sat Jun 18 22:45:43 2016 +0800
+++ b/viewer.py Sun Jun 19 00:04:48 2016 +0800
from peewee import DoesNotExist
from tornado.escape import json_decode
if not database.is_closed():
+ def write_error(self, status_code, **kwargs):
+ 'message': self._reason,
+ if 'exc_info' in kwargs:
+ if self.settings.get('serve_traceback'):
+ fexc = traceback.format_exception(*kwargs['exc_info'])
+ data['debug_message'] = '\n'.join(fexc)
+ self.render('404.html', **data)
+ self.render('500.html', **data)
class IndexHandler(BaseHandler):