Skip to content

Commit

Permalink
Handle 500 errors with custom error page
Browse files Browse the repository at this point in the history
  • Loading branch information
kamalgill committed Dec 13, 2010
1 parent d6baa04 commit 4ac93bb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/application/templates/500.html
@@ -0,0 +1,8 @@
{% extends "base.html" %}

{% block content %}
<h1>Aw, snap</h1>
<p>The server encountered an unexpected error.</p>
<p>Please try again later.</p>
{% endblock %}

5 changes: 5 additions & 0 deletions src/application/urls.py
Expand Up @@ -39,3 +39,8 @@
def page_not_found(e):
return render_template('404.html'), 404

# Handle 500 errors
@app.errorhandler(500)
def server_error(e):
return render_template('500.html'), 500

0 comments on commit 4ac93bb

Please sign in to comment.