This is needed because of this Flask error: AssertionError: It is currently not possible to register a 500 internal server error on a per-blueprint level
Signed-off-by: Patrick Uiterwijk patrick@puiterwijk.org
One issue with this is that I believe it will catch 500 errors returned by the API so :(
It actually won't, because API errors are already caught by @api_method: https://pagure.io/pagure/blob/master/f/pagure/api/init.py#_231
@api_method
That endpoint catches the exception raised in the API returns the error code (including possibly a 500) which will then the generic flask handler catches
As to why this doesn't hit in our deployments, the code that checks this is:
assert code_or_exception != 500 or key is None, \ 'It is currently not possible to register a 500 internal ' \ 'server error on a per-blueprint level.'
Any assert statements get stripped with optimized python, which happens in the Fedora pacakges.
assert
Ok despite what I thought it seems to not catch 500 from the API, so let's rebase and merge :)
rebased onto 8ac24ee9b90d773bb0bd8925c6aa7247b6cd290b
Pull-Request has been merged by pingou
This is needed because of this Flask error:
AssertionError: It is currently not possible to register a 500 internal server error on a per-blueprint level
Signed-off-by: Patrick Uiterwijk patrick@puiterwijk.org