-
Notifications
You must be signed in to change notification settings - Fork 30
httpserver: propagate event handler exceptions to httpserver #64
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM :) Kudos for adding thorough testing.
One thing I want to ask: why do you create a separate list for handler errors? Is this because of backward compatibility to guarantee that exceptions raised from the request handlers will still be ignored in check_assertions?
I'm thinking about adding one single check() function which would call these two method sequentially, so if someone is using a custom error handler they would benefit from both world. What do you think, would this make sense?
This would still keep the API compatible (check_assertions would not change) and if we document that the range of errors checked can change in the future, new calls could be added there later. Naming would be check() or check_all() or something like this.
sure, maybe the separation is not needed. happy to consolidate the two functions. |
I see the benefit of the separation (this wasn't true when I first saw your code, I admit). It provides backward compatibility and also provides some kind of differentiation of the "some expected result is not okay" between "some unhandled and nasty thing happened". AFAIK that's the difference between failure and error in the terms of testing and it is good to be separated. |
Codecov Report
@@ Coverage Diff @@
## master #64 +/- ##
==========================================
+ Coverage 94.05% 94.33% +0.28%
==========================================
Files 3 3
Lines 437 459 +22
==========================================
+ Hits 411 433 +22
Misses 26 26
Continue to review full report at Codecov.
|
It seems that there's an unused import in your commit, could you fix that?
|
i fixed the import error (my bad) and also added the |
Thanks! :) Just one little final ask: could you please squash these commits into one? It would look nicer. Then I will merge it I promise. |
This PR fixes #63
I went for option 1 as proposed in #63
The way it is implemented now should not break user code, as exceptions from handlers are collected and then re-raised.
I also added
__pycache__
to the.gitignore