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

Added test to simulate an error I had where an imported reference failed... #1938

Closed

Conversation

harmon
Copy link

@harmon harmon commented Oct 11, 2014

... and the python property swallowed the exception raised in my authenticator.

…led and the python property swallowed the exception raised in my authenticator.
try:
self._authenticate()
except AttributeError as error:
raise RuntimeError("AttributeError: " + error.message)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can still keep the existing traceback which will be useful for debugging by using six.reraise. I think it would look like:

six.reraise(RuntimeError, "AttributeError: " + str(error), sys.exc_info()[2])

And error.message is not available in Python 3. You should use the str(error) instead.

@tomchristie
Copy link
Member

Looks like this needs updating to latest master.

@tomchristie
Copy link
Member

Superseeded by #2530, which includes your test. Thanks for your work on this! :)

@tomchristie tomchristie closed this Feb 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants