Ticket #208 (defect)
Opened 4 years ago
Last modified 3 years ago
Filter exception handling
Status: closed (fixed)
| Reported by: | peterhunt | Assigned to: | rdelon |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | CherryPy code | Keywords: | |
| Cc: |
- You can't raise HTTPRedirect from beforeErrorResponse
- Filter lists should be completely iterated through, even if one filter in the chain raises an exception
- Original exceptions should be re-raised between each filter so that there is a proper exc_info() for each one.
I can do this patch.
Change History
06/30/05 10:50:59: Modified by lawouach
07/02/05 10:15:13: Modified by fumanchu
> You can't raise HTTPRedirect from beforeErrorResponse
That would be a good thing to fix, in order to enable generic error redirects.
However, I disagree with point 2. Filter authors should instead have their beforeErrorResponse method do any cleanup from an aborted request. The only exception to that rule is onEndResource, which should fire regardless. That stance also makes #3 moot, I think.
09/11/05 01:08:58: Modified by fumanchu
- status changed from new to closed.
- resolution set to fixed.
- description changed.
Point 1 fixed in [624]. Points 2 and 3 won't be implemented.


I'd rather have either a specific filter to handle exceptions, or maybe a new function to basefilter called "onException"
Returning true to stop the process chain, or false to let CP continue with the request as if nothing happened