All, I'm trying to raise a custom error using Flask-Restful, following the docs. For testing purposes, I've defined and registered the errors dictionary exactly link in the docs: api = flask_restful.Api(app, errors=errors)
.
However, when I want to raise the custom error using (e.g.) abort(409)
within the resource module, firebug reports:
{ "message": "Conflict", "status": 409 }
This seems like the standard 409 error, nothing custom; from the docs, I would expect the custom error message- "A user with that username already exists."
I think I'm missing something regarding the raising of the error itself. Should I use the dictionary key in any way? Reviewing the Flask-Restful source code didn't help, though I tried.