def on_json_loading_failed(self, e): """Called if decoding of the JSON data failed. The return value of this method is used by :attr:`json` when an error ocurred. """ I_M_BAD = BadRequest() I_M_BAD.json_parse_error = True raise I_M_BAD