--- a/tests/test_viewer.py Sun Jun 19 00:04:48 2016 +0800
+++ b/tests/test_viewer.py Sun Jun 19 00:18:30 2016 +0800
response = self.fetch('/')
assert response.code == 200
+ assert 'online linter' in response.body
response = self.fetch('/nobodyhere')
assert response.code == 404
+ assert 'online linter' in response.body
--- a/viewer.py Sun Jun 19 00:04:48 2016 +0800
+++ b/viewer.py Sun Jun 19 00:18:30 2016 +0800
from tornado.ioloop import IOLoop
from tornado.options import define, options
from tornado.web import Application, HTTPError, RequestHandler, URLSpec
+from tornado.web import ErrorHandler as BaseErrorHandler
from candolint import uimodules
from candolint.models import database, Project, Change, Check
self.render('status.svg', width=width, parts=parts, height=20)
+class ErrorHandler(BaseHandler, BaseErrorHandler):
class CandolintViewer(Application):
URLSpec(r'/([.a-z0-9_-]+)/([^/]+)/([^/]+)', ProjectHandler),
URLSpec(r'/([.a-z0-9_-]+)/([^/]+)/([^/]+)/([\d]+|latest)', CheckHandler),
URLSpec(r'/([.a-z0-9_-]+)/([^/]+)/([^/]+)/status\.svg', StatusHandler),
+ URLSpec(r'.*', ErrorHandler, {'status_code': 404})
static_path=rel('static'),