Skip to content

Reraise exceptions within #request instead of continuing #35

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mistydemeo
Copy link

@mistydemeo mistydemeo commented Mar 14, 2017

Previously, if an exception was raised in #request, the function would be allowed to continue through to returning the callback. This callback would almost certainly fail. Raising here, rather than returning after calling the callback with the exception, makes more sense to me because the return value is still expected to be a function.

I ran into this when an exception was raised on the line where req is assigned; it went on to return the function anyway, which then failed because req was never defined.

cc @technicalpickles

Previously, if an exception was raised in #request, the function would
be allowed to continue through to returning the callback. This callback
would almost certainly fail.
@technicalpickles
Copy link
Collaborator

I'm just trying to think if there'd be any problems with having a callback getting the error, and also the error being thrown.

Considering it's part of the setup, it probably makes more sense to just throw it, but I'm not sure how that'd impact consumers.

@mistydemeo
Copy link
Author

Updated to just throw - at that point, we don't need to catch the exception anymore. (Diff best viewed with ?w=1.) I don't know enough about the impact this might have on other users, but I did get bit by this again today, so it'd be useful to get this in!

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.

2 participants