diff options
author | Cédric Bonhomme <kimble.mandel@gmail.com> | 2012-12-29 22:45:45 +0100 |
---|---|---|
committer | Cédric Bonhomme <kimble.mandel@gmail.com> | 2012-12-29 22:45:45 +0100 |
commit | a85cdf1ec92bc995daaff3657b3b4abaace6f180 (patch) | |
tree | 4cc5eaea01d5a15fe27ac1e6194527fa23ec0904 /source/pyAggr3g470r.py | |
parent | add_feed now uses templated. (diff) | |
download | newspipe-a85cdf1ec92bc995daaff3657b3b4abaace6f180.tar.gz newspipe-a85cdf1ec92bc995daaff3657b3b4abaace6f180.tar.bz2 newspipe-a85cdf1ec92bc995daaff3657b3b4abaace6f180.zip |
Improved error response.
Diffstat (limited to 'source/pyAggr3g470r.py')
-rwxr-xr-x | source/pyAggr3g470r.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/pyAggr3g470r.py b/source/pyAggr3g470r.py index 7dafc52e..7a6e450e 100755 --- a/source/pyAggr3g470r.py +++ b/source/pyAggr3g470r.py @@ -62,16 +62,17 @@ def error_404(status, message, traceback, version): """ Display an error if the page does not exist. """ - html = "<br /><br />Error %s - This page does not exist." % status - return html + message = "<pError %s - This page does not exist.</p>" % status + tmpl = lookup.get_template("error.html") + return tmpl.render(message=message) def handle_error(): """ Handle different type of errors. """ - html = "<br /><br />Sorry, an error occured" + message = "<p>Sorry, an error occured.</p>" cherrypy.response.status = 500 - cherrypy.response.body = [html] + cherrypy.response.body = [message] class RestrictedArea(object): """ @@ -332,8 +333,7 @@ class pyAggr3g470r(object): description = "Unvailable" tmpl = lookup.get_template("plain_text.html") return tmpl.render(feed_title=feed["feed_title"], \ - article_title=article["article_title"], \ - description = description) + article_title=article["article_title"], description = description) plain_text.exposed = True |