Package fr.enedis.chutney
Class RestExceptionHandler
java.lang.Object
org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
fr.enedis.chutney.RestExceptionHandler
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.context.MessageSourceAware
@ControllerAdvice
public class RestExceptionHandler
extends org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
-
Field Summary
Fields inherited from class org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
logger, PAGE_NOT_FOUND_LOG_CATEGORY, pageNotFoundLogger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<Object> _500(RuntimeException ex, org.springframework.web.context.request.WebRequest request) protected org.springframework.http.ResponseEntity<Object> badRequest(RuntimeException ex, org.springframework.web.context.request.WebRequest request) protected org.springframework.http.ResponseEntity<Object> conflict(RuntimeException ex, org.springframework.web.context.request.WebRequest request) protected org.springframework.http.ResponseEntity<Object> forbidden(RuntimeException ex, org.springframework.web.context.request.WebRequest request) protected org.springframework.http.ResponseEntity<Object> handleHttpMessageNotReadable(org.springframework.http.converter.HttpMessageNotReadableException ex, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatusCode status, org.springframework.web.context.request.WebRequest request) protected org.springframework.http.ResponseEntity<Object> handleHttpMessageNotWritable(org.springframework.http.converter.HttpMessageNotWritableException ex, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatusCode status, org.springframework.web.context.request.WebRequest request) protected org.springframework.http.ResponseEntity<Object> notFound(RuntimeException ex, org.springframework.web.context.request.WebRequest request) protected org.springframework.http.ResponseEntity<Object> notImplemented(RuntimeException ex, org.springframework.web.context.request.WebRequest request) protected org.springframework.http.ResponseEntity<Object> unprocessableEntity(RuntimeException ex, org.springframework.web.context.request.WebRequest request) Methods inherited from class org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
createProblemDetail, createResponseEntity, getMessageSource, handleAsyncRequestNotUsableException, handleAsyncRequestTimeoutException, handleConversionNotSupported, handleErrorResponseException, handleException, handleExceptionInternal, handleHandlerMethodValidationException, handleHttpMediaTypeNotAcceptable, handleHttpMediaTypeNotSupported, handleHttpRequestMethodNotSupported, handleMaxUploadSizeExceededException, handleMethodArgumentNotValid, handleMethodValidationException, handleMissingPathVariable, handleMissingServletRequestParameter, handleMissingServletRequestPart, handleNoHandlerFoundException, handleNoResourceFoundException, handleServletRequestBindingException, handleTypeMismatch, setMessageSource
-
Constructor Details
-
RestExceptionHandler
-
-
Method Details
-
handleHttpMessageNotReadable
protected org.springframework.http.ResponseEntity<Object> handleHttpMessageNotReadable(org.springframework.http.converter.HttpMessageNotReadableException ex, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatusCode status, org.springframework.web.context.request.WebRequest request) - Overrides:
handleHttpMessageNotReadablein classorg.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
-
handleHttpMessageNotWritable
protected org.springframework.http.ResponseEntity<Object> handleHttpMessageNotWritable(org.springframework.http.converter.HttpMessageNotWritableException ex, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatusCode status, org.springframework.web.context.request.WebRequest request) - Overrides:
handleHttpMessageNotWritablein classorg.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
-
_500
@ExceptionHandler({fr.enedis.chutney.server.core.domain.execution.FailedExecutionAttempt.class,java.lang.RuntimeException.class}) public org.springframework.http.ResponseEntity<Object> _500(RuntimeException ex, org.springframework.web.context.request.WebRequest request) -
notFound
@ExceptionHandler({BackupNotFoundException.class,CampaignExecutionNotFoundException.class,CampaignNotFoundException.class,CurrentUserNotFoundException.class,fr.enedis.chutney.server.core.domain.dataset.DataSetNotFoundException.class,fr.enedis.chutney.environment.domain.exception.EnvironmentNotFoundException.class,fr.enedis.chutney.server.core.domain.execution.report.ReportNotFoundException.class,fr.enedis.chutney.server.core.domain.scenario.ScenarioNotFoundException.class,fr.enedis.chutney.server.core.domain.execution.ScenarioNotRunningException.class,fr.enedis.chutney.environment.domain.exception.TargetNotFoundException.class,fr.enedis.chutney.server.core.domain.dataset.DataSetNotFoundException.class}) protected org.springframework.http.ResponseEntity<Object> notFound(RuntimeException ex, org.springframework.web.context.request.WebRequest request) -
conflict
@ExceptionHandler({fr.enedis.chutney.environment.domain.exception.AlreadyExistingEnvironmentException.class,fr.enedis.chutney.server.core.domain.scenario.AlreadyExistingScenarioException.class,fr.enedis.chutney.environment.domain.exception.AlreadyExistingTargetException.class,CampaignAlreadyRunningException.class,fr.enedis.chutney.server.core.domain.dataset.DataSetAlreadyExistException.class,fr.enedis.chutney.environment.domain.exception.SingleEnvironmentException.class,CampaignEmptyExecutionException.class,fr.enedis.chutney.server.core.domain.execution.RunningScenarioExecutionDeleteException.class}) protected org.springframework.http.ResponseEntity<Object> conflict(RuntimeException ex, org.springframework.web.context.request.WebRequest request) -
unprocessableEntity
@ExceptionHandler({fr.enedis.chutney.server.core.domain.execution.ScenarioConversionException.class,fr.enedis.chutney.server.core.domain.scenario.ScenarioNotParsableException.class}) protected org.springframework.http.ResponseEntity<Object> unprocessableEntity(RuntimeException ex, org.springframework.web.context.request.WebRequest request) -
badRequest
@ExceptionHandler({java.time.format.DateTimeParseException.class,org.springframework.http.converter.HttpMessageConversionException.class,fr.enedis.chutney.environment.domain.exception.InvalidEnvironmentNameException.class,java.lang.IllegalArgumentException.class}) protected org.springframework.http.ResponseEntity<Object> badRequest(RuntimeException ex, org.springframework.web.context.request.WebRequest request) -
forbidden
@ExceptionHandler(org.springframework.security.access.AccessDeniedException.class) protected org.springframework.http.ResponseEntity<Object> forbidden(RuntimeException ex, org.springframework.web.context.request.WebRequest request) -
notImplemented
@ExceptionHandler(java.lang.UnsupportedOperationException.class) protected org.springframework.http.ResponseEntity<Object> notImplemented(RuntimeException ex, org.springframework.web.context.request.WebRequest request)
-