def _handle_bad_request(error): """Handles the bad request raised by reqparse""" if not isinstance(error, WebConsoleApiException): # error.data.message contains the details raised by reqparse details = None if error.data is not None: details = error.data['message'] return make_response(InvalidArgumentException(details)) return error
def _handle_not_found(error): """Handles the not found exception raised by framework""" if not isinstance(error, WebConsoleApiException): return make_response(NotFoundException()) return error