aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcedricbonhomme <devnull@localhost>2011-09-21 16:11:43 +0200
committercedricbonhomme <devnull@localhost>2011-09-21 16:11:43 +0200
commit5bcaa4a83dd243529376602a508d7ab8fff2e501 (patch)
treeb155912109201b0f78abae5ca7bd860388bda399
parentMinor improvement of the display of the error 404 page. (diff)
downloadnewspipe-5bcaa4a83dd243529376602a508d7ab8fff2e501.tar.gz
newspipe-5bcaa4a83dd243529376602a508d7ab8fff2e501.tar.bz2
newspipe-5bcaa4a83dd243529376602a508d7ab8fff2e501.zip
Added handle_error() function.
-rwxr-xr-xpyAggr3g470r.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/pyAggr3g470r.py b/pyAggr3g470r.py
index 0185ae61..b45a19f6 100755
--- a/pyAggr3g470r.py
+++ b/pyAggr3g470r.py
@@ -52,9 +52,21 @@ def error_page_404(status, message, traceback, version):
html += "\n<hr />\n" + htmlfooter
return html
+def handle_error():
+ """
+ Handle different type of errors.
+ """
+ html = htmlheader()
+ html += htmlnav
+ html += "<br /><br />Sorry, an error occured"
+ html += "\n<hr />\n" + htmlfooter
+ cherrypy.response.status = 500
+ cherrypy.response.body = [html]
+
bindhost = "0.0.0.0"
cherrypy.config.update({ 'server.socket_port': 12556, 'server.socket_host': bindhost})
cherrypy.config.update({'error_page.404': error_page_404})
+_cp_config = {'request.error_response': handle_error}
# static files
path = {'/css/style.css': {'tools.staticfile.on': True, \
bgstack15