Search code examples
flaskerror-handlingflask-restplus

Remove added error information from response


Using flask-restplus I've noticed that if I handle some error like:

api.abort(code=404, message='Item not found')

The response renders:

{
  "message": "Item not found. You have requested this URI [/item/1]
              but did you mean /item/<item_id> ?"
}

I really don't want that extra bit of information but can't find a way to remove it.

Is there one?


Solution

  • So, there is a config flag for this. Reported here

    ERROR_404_HELP=False
    

    Does the trick