Fixing behavior issue when route raising Exception#21
Fixing behavior issue when route raising Exception#21staytime wants to merge 3 commits intopimoroni:mainfrom
Conversation
1. Adding Exception handling when processing route. 2. Adding decorator "errorhandler" for customizing in user code.
|
@staytime @Gadgetoid This PR is heading in the right direction. However, Phew is a framework that is used by other applications. The behaviour in this PR while an improvement does not give control into the hands of the application developer. Note that I'ved used my branch of Phew ccrighton/phew in the examples below. Ideally, we would:
Again could be done after initial implementation without breaking anything.
It would be worth considering adding an abort(code) method that raises an HTTPException based on the given status code. This is supported by Flask. They also support code or exception e.g. |
Background
Consider following code
Presently _handle_request will return not thing,
Leading client hang until timeout.
Change
This pull request change are following