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
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
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
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