'Called if :meth:`get_json` parsing fails and isn\'t silenced. If
this method returns a value, it is used as the return value for
:meth:`get_json`. The default implementation raises a
:class:`BadRequest` exception.
.. versionchanged:: 0.10
Raise a :exc:`BadRequest` error instead of returning an error
message as JSON. If you want that behavior you can add it by
subclassing.
.. versionadded:: 0.8'

def on_json_loading_failed(self, e):

    if ((current_app is not None) and current_app.debug):
        raise BadRequest('Failed    to    decode    JSON    object:    {0}'.format(e))
    raise BadRequest()
