summaryrefslogtreecommitdiffstats
path: root/ipa-server/ipa-gui/ipagui/controllers.py
diff options
context:
space:
mode:
Diffstat (limited to 'ipa-server/ipa-gui/ipagui/controllers.py')
-rw-r--r--ipa-server/ipa-gui/ipagui/controllers.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/ipa-server/ipa-gui/ipagui/controllers.py b/ipa-server/ipa-gui/ipagui/controllers.py
index 1ec56b25..024a804d 100644
--- a/ipa-server/ipa-gui/ipagui/controllers.py
+++ b/ipa-server/ipa-gui/ipagui/controllers.py
@@ -84,11 +84,14 @@ class Root(controllers.RootController):
"""This method is derived from the sample error catcher on
http://docs.turbogears.org/1.0/ErrorReporting."""
try:
- cherrypy._cputil._cp_on_http_error(status, message)
error_msg = self._error_codes.get(status, self._error_codes[None])
url = "%s %s" % (cherrypy.request.method, cherrypy.request.path)
- log.exception("CherryPy %s error (%s) for request '%s'", status,
- error_msg, url)
+ if (status == 500):
+ log.exception("%s error (%s) for request '%s'", status,
+ error_msg, url)
+ else:
+ log.error("%s error (%s) for request '%s'", status,
+ error_msg, url)
if config.get('server.environment') == 'production':
details = ''
@@ -106,9 +109,14 @@ class Root(controllers.RootController):
details = details,
)
+ if status == 404:
+ page_template = 'ipagui.templates.not_found'
+ else:
+ page_template = 'ipagui.templates.unhandled_exception'
+
body = controllers._process_output(
data,
- 'ipagui.templates.unhandled_exception',
+ page_template,
'html',
'text/html',
None