#NEWLINE# def on_json_loading_failed( self , e ) : #NEWLINE# #INDENT# 'Called if decoding of the JSON data failed.  The return value of\n        this method is used by :meth:`get_json` when an error occurred.  The\n        default implementation just raises a :class:`BadRequest` exception.\n\n        .. versionchanged:: 0.10\n           Removed buggy previous behavior of generating a random JSON\n           response.  If you want that behavior back you can trivially\n           add it by subclassing.\n\n        .. versionadded:: 0.8\n        ' #NEWLINE# ctx = _request_ctx_stack . top #NEWLINE# if ( ( e is not None ) and ctx . app . config . get ( 'DEBUG' , False ) ) : #NEWLINE# #INDENT# raise BadRequest ( 'Failed to decode JSON object: {0}' . format ( e ) ) #NEWLINE# #UNINDENT# raise BadRequest ( )