Esempio n. 1
0
 def _handle_unexpected_exception(exception: Exception):
     """Handle an unexpected exception."""
     LOGGER.critical("Unexpected exception: %s", exception, exc_info=True)
     response = jsonify(exception_message(exception))
     response.status_code = 500
     return response
Esempio n. 2
0
 def _handle_problem_exception(exception: ProblemException):
     """Render a ProblemException according to ParallelCluster API specs."""
     response = jsonify(exception_message(exception))
     response.status_code = exception.status
     return response
Esempio n. 3
0
 def _handle_parallel_cluster_api_exception(
         exception: ParallelClusterApiException):
     """Render a ParallelClusterApiException according to ParallelCluster API specs."""
     response = jsonify(exception_message(exception))
     response.status_code = exception.code
     return response
Esempio n. 4
0
 def _handle_http_exception(exception: HTTPException):
     """Render a HTTPException according to ParallelCluster API specs."""
     response = jsonify(exception_message(exception))
     response.status_code = exception.code
     return response