# HG changeset patch # User Steve Losh # Date 1278786180 14400 # Node ID 62247513862f67add15908157102449cc6da592a # Parent 9d8c2dd1ed72eb565e8a5b9a85a7afa213f76c1c web: add nice error pages diff -r 9d8c2dd1ed72 -r 62247513862f review/templates/404.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/review/templates/404.html Sat Jul 10 14:23:00 2010 -0400 @@ -0,0 +1,9 @@ +{% extends "base.html" %} + +{% block id %}404{% endblock %} +{% block title %}Page not found - {% endblock %} + +{% block content %} +

Page not found (404)

+

The page you requested could not be found. Go home.

+{% endblock %} diff -r 9d8c2dd1ed72 -r 62247513862f review/templates/500.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/review/templates/500.html Sat Jul 10 14:23:00 2010 -0400 @@ -0,0 +1,13 @@ +{% extends "base.html" %} + +{% block id %}500{% endblock %} +{% block title %}Server error - {% endblock %} + +{% block content %} +

Server error (500)

+

Something went horribly wrong.

+

+ If you have a few extra minutes you could + file a bug report. +

+{% endblock %} diff -r 9d8c2dd1ed72 -r 62247513862f review/web.py --- a/review/web.py Sat Jul 10 14:14:25 2010 -0400 +++ b/review/web.py Sat Jul 10 14:23:00 2010 -0400 @@ -210,6 +210,14 @@ return redirect('%s/' % app.site_root) +@app.errorhandler(404) +def page_not_found(error): + return _render('404.html'), 404 + +@app.errorhandler(500) +def server_error(error): + return _render('500.html'), 500 + def load_interface(ui, repo, read_only=False, allow_anon=False, open=False, address='127.0.0.1', port=8080): if open: