Skip to content

Instantly share code, notes, and snippets.

@georgexsh
Last active December 19, 2015 17:48
Show Gist options
  • Save georgexsh/5993801 to your computer and use it in GitHub Desktop.
Save georgexsh/5993801 to your computer and use it in GitHub Desktop.
import sys
from gunicorn import util
from gunicorn.app.base import Application
def make_tb_echo_app(exc):
def app(environ, start_response):
exc_type, exc_value, exc_info = exc
# TODO logging the exception or re-raise
return app
class MyApplication(Application):
def load(self):
try:
return util.import_app(self.app_uri)
except Exception, e:
exc = sys.exc_info()
return make_tb_echo_app(exc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment