There are a few issues... (shouldn't be merged yet)
The abort(code) works, but raise ApiException() doesn't work with the json response, in my opinion, raising an ApiException should automatically result in a 500 json handling, but it's not.
The flask_abort() and api_abort() use cases work anyway... I just want to handle them elegantly. (What should be the behavior if the user raises ApiException() instead of flask_smorest.abort()?)
I looked at the method you mentioned in the original issue(re-define all werkzeug exceptions), and my guess is that since we are inheriting and defining some exceptions from Flask-Smorest, it would be better to explicitly inherit them all, even if it makes the code a bit longer (I'd love to hear your opinion).
There are a few issues... (shouldn't be merged yet)
The
abort(code)
works, but raise ApiException() doesn't work with the json response, in my opinion, raising anApiException
should automatically result in a 500 json handling, but it's not. Theflask_abort()
andapi_abort()
use cases work anyway... I just want to handle them elegantly. (What should be the behavior if the user raisesApiException()
instead offlask_smorest.abort()
?)I looked at the method you mentioned in the original issue(re-define all werkzeug exceptions), and my guess is that since we are inheriting and defining some exceptions from Flask-Smorest, it would be better to explicitly inherit them all, even if it makes the code a bit longer (I'd love to hear your opinion).