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

Print stack trace after catching ImportError upon entrypoint.load() #1029

Conversation

sphuber
Copy link
Contributor

@sphuber sphuber commented Dec 22, 2017

Fixes #1019

The exception handling of the caught ImportError when calling
entrypoint.load() in the get_plugin() method caused the original
ImportError to be swallowed and just raised the LoadingPluginFailed.
We now also print the stack trace of the ImportError so that the
user knows why the loading of the plugin failed.

The exception handling of the caught ImportError when calling
entrypoint.load() in the get_plugin() method caused the original
ImportError to be swallowed and just raised the LoadingPluginFailed.
We not also print the stack trace of the ImportError so that the
user knows why the loading of the plugin failed.
Copy link
Member

@ltalirz ltalirz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @sphuber , that's very helpful (I checked and it works: it now prints both tracebacks, one for the custom exception and, afterwards, the one for the import error).
For me this would be fine, let's wait perhaps for the feedback from the others.

@giovannipizzi giovannipizzi merged commit 6870001 into aiidateam:develop Dec 22, 2017
@sphuber sphuber deleted the fix_1019_print_stacktrace_load_plugin_fail branch December 22, 2017 21:47
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

Successfully merging this pull request may close these issues.

3 participants