Permalink
Browse files

Added error pages

  • Loading branch information...
1 parent 080e7f1 commit 8631ccd266dced2dc3e83a707885e34e2e9d01b5 @dcramer committed Jun 25, 2011
Showing with 48 additions and 6 deletions.
  1. +10 −6 sentry/static/styles/global.css
  2. +14 −0 sentry/templates/sentry/404.html
  3. +16 −0 sentry/templates/sentry/500.html
  4. +8 −0 sentry/web/views.py
@@ -176,7 +176,7 @@ img {
background: #fff;
max-width: 100%;
overflow: hidden;
- margin: 2em 0 2em 2em;
+ margin: 1em;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
@@ -204,7 +204,7 @@ img {
#sidebar {
float: right;
width: 300px;
- margin: 0em 2em 2em 1.5em;
+ margin: 0em 1em 1em 0;
background: inherit;
overflow: hidden;
}
@@ -655,18 +655,22 @@ dl.flat dd {
background: inherit;
}
-.login-area {
- width: 300px;
+.error-page, .login-area {
+ width: 500px;
margin: 50px auto;
- background: #eee;
+ background: #fff;
border: 1px solid #ddd;
- padding: 10px;
+ padding: 1em 1em 0;
+ -moz-border-radius: 8px;
+ -webkit-border-radius: 8px;
+ border-radius: 8px;
}
.login-area p {
margin-bottom: 10px;
}
.login-form table { width: 295px; }
.login-form td { padding: 2px 0; }
+
form table {
border: 0;
margin: 1em 0;
@@ -0,0 +1,14 @@
+{% extends "sentry/layout.html" %}
+
+{% block title %}{{ gettext('Page Not Found') }} | {{ super() }}{% endblock %}
+
+{% block heading %}{{ gettext('Page Not Found') }}{% endblock %}
+
+{% block search %}{% endblock %}
+
+{% block content %}
+ <div class="error-page">
+ <h2>{{ gettext('Page Not Found') }}</h2>
+ <p>{{ gettext('The page you were looking for was not found.') }}</p>
+ </div>
+{% endblock %}
@@ -0,0 +1,16 @@
+{% extends "sentry/layout.html" %}
+
+{% block title %}{{ gettext('Internal Server Error') }} | {{ super() }}{% endblock %}
+
+{% block heading %}{{ gettext('Internal Server Error') }}{% endblock %}
+
+{% block search %}{% endblock %}
+
+{% block content %}
+ <div id="body">
+ <div class="error-page">
+ <h2>{{ gettext('Internal Server Error') }}</h2>
+ <p>{{ gettext('There was an internal server error loading the page you requested.') }}</p>
+ </div>
+ </div>
+{% endblock %}
View
@@ -39,6 +39,14 @@ def wrapped(*args, **kwargs):
wrapped.__wraps__ = getattr(func, '__wraps__', func)
return wrapped
+@app.errorhandler(404)
+def page_not_found(e):
+ return render_template('sentry/404.html'), 404
+
+@app.errorhandler(500)
+def internal_server_error(e):
+ return render_template('sentry/500.html'), 500
+
@app.context_processor
def context():
return {

0 comments on commit 8631ccd

Please sign in to comment.