예제 #1
0
 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)
예제 #2
0
 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)
예제 #3
0
 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)
예제 #4
0
 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)
예제 #5
0
 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)
예제 #6
0
 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)
예제 #7
0
파일: args.py 프로젝트: mbland/openFEC
 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)
예제 #8
0
파일: args.py 프로젝트: dwillis/openFEC
 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)
예제 #9
0
 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)