Package com.chutneytesting
Class RestExceptionHandler
- java.lang.Object
-
- org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
-
- com.chutneytesting.RestExceptionHandler
-
@ControllerAdvice public class RestExceptionHandler extends org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
-
-
Constructor Summary
Constructors Constructor Description RestExceptionHandler(ChutneyMetrics metrics)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.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.HttpStatus 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.HttpStatus 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>unprocessableEntity(RuntimeException ex, org.springframework.web.context.request.WebRequest request)-
Methods inherited from class org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
handleAsyncRequestTimeoutException, handleBindException, handleConversionNotSupported, handleException, handleExceptionInternal, handleHttpMediaTypeNotAcceptable, handleHttpMediaTypeNotSupported, handleHttpRequestMethodNotSupported, handleMethodArgumentNotValid, handleMissingPathVariable, handleMissingServletRequestParameter, handleMissingServletRequestPart, handleNoHandlerFoundException, handleServletRequestBindingException, handleTypeMismatch
-
-
-
-
Constructor Detail
-
RestExceptionHandler
public RestExceptionHandler(ChutneyMetrics metrics)
-
-
Method Detail
-
handleHttpMessageNotReadable
protected org.springframework.http.ResponseEntity<Object> handleHttpMessageNotReadable(org.springframework.http.converter.HttpMessageNotReadableException ex, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatus 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.HttpStatus status, org.springframework.web.context.request.WebRequest request)
- Overrides:
handleHttpMessageNotWritablein classorg.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
-
_500
@ExceptionHandler({com.chutneytesting.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,com.chutneytesting.component.scenario.domain.ComposableStepNotFoundException.class,CurrentUserNotFoundException.class,com.chutneytesting.component.dataset.domain.DataSetNotFoundException.class,com.chutneytesting.environment.domain.exception.EnvironmentNotFoundException.class,com.chutneytesting.server.core.domain.globalvar.GlobalVarNotFoundException.class,com.chutneytesting.server.core.domain.execution.report.ReportNotFoundException.class,com.chutneytesting.server.core.domain.scenario.ScenarioNotFoundException.class,com.chutneytesting.server.core.domain.execution.ScenarioNotRunningException.class,com.chutneytesting.environment.domain.exception.TargetNotFoundException.class}) protected org.springframework.http.ResponseEntity<Object> notFound(RuntimeException ex, org.springframework.web.context.request.WebRequest request)
-
conflict
@ExceptionHandler({com.chutneytesting.environment.domain.exception.AlreadyExistingEnvironmentException.class,com.chutneytesting.server.core.domain.scenario.AlreadyExistingScenarioException.class,com.chutneytesting.environment.domain.exception.AlreadyExistingTargetException.class,CampaignAlreadyRunningException.class}) protected org.springframework.http.ResponseEntity<Object> conflict(RuntimeException ex, org.springframework.web.context.request.WebRequest request)
-
unprocessableEntity
@ExceptionHandler({com.chutneytesting.server.core.domain.execution.ScenarioConversionException.class,com.chutneytesting.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,com.chutneytesting.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)
-
-