@ControllerAdvice public class RestControllerAdvice extends Object
Constructor and Description |
---|
RestControllerAdvice() |
Modifier and Type | Method and Description |
---|---|
org.springframework.hateoas.VndErrors |
onClientGenericBadRequest(Exception e)
Client did not formulate a correct request.
|
org.springframework.hateoas.VndErrors |
onConflictException(Exception e)
Log the exception message at warn level and stack trace as trace level.
|
org.springframework.hateoas.VndErrors |
onConstraintViolationException(javax.validation.ConstraintViolationException e)
The exception handler is trigger if a JSR303
ConstraintViolationException
is being raised. |
org.springframework.hateoas.VndErrors |
onException(Exception e)
Handles the general error case.
|
org.springframework.hateoas.VndErrors |
onNotFoundException(Exception e)
Log the exception message at warn level and stack trace as trace level.
|
org.springframework.hateoas.VndErrors |
onUnprocessableEntityException(Exception e)
Log the exception message at warn level and stack trace as trace level.
|
@ExceptionHandler(value=java.lang.Exception.class) @ResponseStatus(value=INTERNAL_SERVER_ERROR) @ResponseBody public org.springframework.hateoas.VndErrors onException(Exception e)
e
- the exception not handled by other exception handler methods@ExceptionHandler(value={AppAlreadyRegisteredException.class,DuplicateStreamDefinitionException.class,DuplicateTaskException.class,StreamAlreadyDeployedException.class,StreamAlreadyDeployingException.class,UnregisterAppException.class}) @ResponseStatus(value=CONFLICT) @ResponseBody public org.springframework.hateoas.VndErrors onConflictException(Exception e)
e
- one of the exceptions, AppAlreadyRegisteredException
,
DuplicateStreamDefinitionException
, DuplicateTaskException
,
StreamAlreadyDeployedException
, StreamAlreadyDeployingException
, or
StreamAlreadyDeployingException
@ExceptionHandler(value={JobNotRestartableException.class,org.springframework.batch.core.launch.JobExecutionNotRunningException.class}) @ResponseStatus(value=UNPROCESSABLE_ENTITY) @ResponseBody public org.springframework.hateoas.VndErrors onUnprocessableEntityException(Exception e)
e
- one of the exceptions, JobNotRestartableException
or
JobExecutionNotRunningException
@ExceptionHandler(value={NoSuchStreamDefinitionException.class,NoSuchAppRegistrationException.class,NoSuchTaskDefinitionException.class,NoSuchTaskExecutionException.class,org.springframework.batch.core.launch.NoSuchJobExecutionException.class,org.springframework.batch.core.launch.NoSuchJobInstanceException.class,org.springframework.batch.core.launch.NoSuchJobException.class,org.springframework.batch.admin.service.NoSuchStepExecutionException.class,NoSuchTaskBatchException.class,org.springframework.boot.actuate.endpoint.mvc.MetricsMvcEndpoint.NoSuchMetricException.class,NoSuchAppException.class,NoSuchAppInstanceException.class,ApplicationDoesNotExistException.class}) @ResponseStatus(value=NOT_FOUND) @ResponseBody public org.springframework.hateoas.VndErrors onNotFoundException(Exception e)
e
- one of the exceptions, NoSuchStreamDefinitionException
,
NoSuchAppRegistrationException
, NoSuchTaskDefinitionException
,
NoSuchTaskExecutionException
, NoSuchJobExecutionException
,
NoSuchJobInstanceException
, NoSuchJobException
,
NoSuchStepExecutionException
,
MetricsMvcEndpoint.NoSuchMetricException
, NoSuchAppException
, or
NoSuchAppInstanceException
@ExceptionHandler(value={org.springframework.web.bind.MissingServletRequestParameterException.class,org.springframework.http.converter.HttpMessageNotReadableException.class,org.springframework.web.bind.UnsatisfiedServletRequestParameterException.class,org.springframework.web.method.annotation.MethodArgumentTypeMismatchException.class,InvalidStreamDefinitionException.class}) @ResponseStatus(value=BAD_REQUEST) @ResponseBody public org.springframework.hateoas.VndErrors onClientGenericBadRequest(Exception e)
e
- one of the exceptions, MissingServletRequestParameterException
,
UnsatisfiedServletRequestParameterException
,
MethodArgumentTypeMismatchException
, or
InvalidStreamDefinitionException
@ExceptionHandler(value=javax.validation.ConstraintViolationException.class) @ResponseStatus(value=BAD_REQUEST) @ResponseBody public org.springframework.hateoas.VndErrors onConstraintViolationException(javax.validation.ConstraintViolationException e)
ConstraintViolationException
is being raised.
Log the exception message at warn level and stack trace as trace level. Return response status HttpStatus.BAD_REQUEST (400).
e
- the exceptions, ConstraintViolationException
Copyright © 2018 Pivotal Software, Inc.. All rights reserved.