def handle_error(self, error): """Handles errors during parsing. Aborts the current HTTP request and responds with a 400 error. """ logger.error(error) status_code = getattr(error, 'status_code', 400) data = getattr(error, 'data', {}) abort(status_code, message=text_type(error), exc=error, **data)
def handle_error(self, error): """Handles errors during parsing. Aborts the current HTTP request and responds with a 400 error. """ logger.error(error) status_code = getattr(error, 'status_code', 400) data = getattr(error, 'data', {}) raise exception_response(status_code, detail=text_type(error), **data)
def handle_error(self, error): """Handles errors during parsing. Aborts the current request with a 400 error. """ logger.error(error) status = getattr(error, 'status_code', 400) data = getattr(error, 'data', {}) raise HTTPError(status=status, body=text_type(error), headers=data.get('headers'), exception=error)
def handle_error(self, error): logger.error(error) message = text_type(error) status_code = getattr(error, 'status_code', 400) payload = getattr(error, 'data', {}) raise exceptions.ApiError(message, status_code, payload)
def handle_error(self, error): logger.error(error) message = text_type(error) status_code = getattr(error, "status_code", 400) payload = getattr(error, "data", {}) raise exceptions.ApiError(message, status_code, payload)
def handle_error(self, error): logger.error(error) status_code = getattr(error, 'status_code', 400) data = getattr(error, 'data', {}) abort(status_code, message=text_type(error), **data)