Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing app with NameError #1333

Closed
ptbrowne opened this issue Aug 23, 2016 · 1 comment
Closed

Importing app with NameError #1333

ptbrowne opened this issue Aug 23, 2016 · 1 comment

Comments

@ptbrowne
Copy link
Contributor

ptbrowne commented Aug 23, 2016

I launch my application with

gunicorn "my_app:create_app()"

In create_app(), if there is a NameError like if variable was not declared, I get an AppImportError which swallows the original exception. I think it would be useful to print the original exception when catching the NameError.

        exc_type, exc_value, exc_traceback = sys.exc_info()
        traceback.print_exception(exc_type, exc_value, exc_traceback,
                                  limit=3, file=sys.stdout)

Made a mini PR.

@benoitc
Copy link
Owner

benoitc commented Oct 16, 2016

applied. thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants