Last active
December 19, 2015 17:48
-
-
Save georgexsh/5993801 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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