I want to add my own http status code to my Flask application. Here is my code:
from werkzeug import exceptions
class UnrecognizedParametersOrCombination(exceptions.HTTPException):
code = 460
description = 'The query parameters or their combination are not recognized!'
exceptions.default_exceptions[460] = UnrecognizedParametersOrCombination
But when I call abort(460), I got error:
LookupError: no exception for 460
It seems I didn't correctly register the new exception to werkzeug default exceptions. The official document is quite blur on this part. How should I do this?