use of alien4cloud.rest.model.RestErrorCode in project alien4cloud by alien4cloud.
the class RestTechnicalExceptionHandler method paaSDeploymentErrorHandler.
@ExceptionHandler(value = PaaSDeploymentException.class)
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
@ResponseBody
public RestResponse<Void> paaSDeploymentErrorHandler(PaaSDeploymentException e) {
log.warn("Error in PaaS Deployment", e);
RestErrorCode errorCode = RestErrorCode.APPLICATION_DEPLOYMENT_ERROR;
if (e.getPassErrorCode() != null) {
errorCode = e.getPassErrorCode();
}
return RestResponseBuilder.<Void>builder().error(RestErrorBuilder.builder(errorCode).message("Application cannot be deployed " + e.getMessage()).build()).build();
}
Aggregations