Skip to content

Instantly share code, notes, and snippets.

@dmitric
Created October 12, 2011 18:27
Show Gist options
  • Save dmitric/1282094 to your computer and use it in GitHub Desktop.
Save dmitric/1282094 to your computer and use it in GitHub Desktop.
#add this to your base handler class
def write_error(self, status_code, **kwargs):
error_trace = None
if self.settings.get("debug") and "exc_info" in kwargs:
import traceback
error_trace= ""
for line in traceback.format_exception(*kwargs["exc_info"]):
error_trace += line
self.render("base_error.html", status_code=status_code, error_trace=error_trace)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment