1. cherrypy
  2. magicbus


Remi Delon  committed 061b637

Better formatting of tracebacks: the page handler is now included at the top. That way the error it still a string and not a tuple so an error message can be on multiple lines and it gets displayed fine in the browser

  • Participants
  • Parent commits d985b13
  • Branches default

Comments (0)

Files changed (1)

File cherrypy/_cputil.py

View file
  • Ignore whitespace
     if exc == (None, None, None):
         return ""
-    return "".join(traceback.format_exception(*exc))
+    args = exc[1].args
+    page_handler = args[-1]
+    page_handler_str = 'Page handler: %s\n' % repr(page_handler)
+    args = args[:-1]
+    exc[1].args = args
+    return page_handler_str + "".join(traceback.format_exception(*exc))
 def bareError(extrabody=None):
     """Produce status, headers, body for a critical error.