X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-web.git/blobdiff_plain/1581471a70984619922f7d0f1d3c5d218cff1faa..1adbd730e54e17845e3f41b03d774f1a1d9b8255:/code/main.py diff --git a/code/main.py b/code/main.py index de0a739..786a087 100755 --- a/code/main.py +++ b/code/main.py @@ -67,14 +67,13 @@ class InvirtWeb(View): @cherrypy.expose @cherrypy.tools.mako(filename="/error.mako") def error(self): - #op, username, fields, err, emsg, traceback): """Print an error page when an exception occurs""" op = cherrypy.request.prev.path_info username = cherrypy.request.login err = cherrypy.request.prev.params["err"] emsg = cherrypy.request.prev.params["emsg"] traceback = cherrypy.request.prev.params["traceback"] - d = dict(op = op, user=username, fields=cherrypy.request.prev.params, + d = dict(op=op, user=username, fields=cherrypy.request.prev.params, errorMessage=str(err), stderr=emsg, traceback=traceback) error_raw = cherrypy.request.lookup.get_template("/error_raw.mako") details = error_raw.render(**d) @@ -98,14 +97,12 @@ class InvirtWeb(View): def handle_error(self): err = sys.exc_info()[1] if isinstance(err, InvalidInput): - e = revertStandardError() cherrypy.request.params['err'] = err - cherrypy.request.params['emsg'] = e + cherrypy.request.params['emsg'] = revertStandardError() raise cherrypy.InternalRedirect('/invalidInput') if not cherrypy.request.prev or 'err' not in cherrypy.request.prev.params: - e = revertStandardError() cherrypy.request.params['err'] = err - cherrypy.request.params['emsg'] = e + cherrypy.request.params['emsg'] = revertStandardError() cherrypy.request.params['traceback'] = _cperror.format_exc() raise cherrypy.InternalRedirect('/error') # fall back to cherrypy default error page