@ControllerAdvice public class RestControllerAdvice extends Object
Constructor and Description |
---|
RestControllerAdvice() |
Modifier and Type | Method and Description |
---|---|
org.springframework.hateoas.mediatype.vnderrors.VndErrors |
onClientGenericBadRequest(Exception e)
Client did not formulate a correct request.
|
org.springframework.hateoas.mediatype.vnderrors.VndErrors |
onConflictException(Exception e)
Log the exception message at warn level and stack trace as trace level.
|
org.springframework.hateoas.mediatype.vnderrors.VndErrors |
onConstraintViolationException(javax.validation.ConstraintViolationException e)
The exception handler is trigger if a JSR303
ConstraintViolationException
is being raised. |
org.springframework.hateoas.mediatype.vnderrors.VndErrors |
onException(Exception e)
Handles the general error case.
|
org.springframework.hateoas.mediatype.vnderrors.VndErrors |
onNotFoundException(Exception e)
Log the exception message at warn level and stack trace as trace level.
|
org.springframework.hateoas.mediatype.vnderrors.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.mediatype.vnderrors.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,InvalidCTRLaunchRequestException.class}) @ResponseStatus(value=CONFLICT) @ResponseBody public org.springframework.hateoas.mediatype.vnderrors.VndErrors onConflictException(Exception e)
e
- one of the exceptions, AppAlreadyRegisteredException
,
DuplicateStreamDefinitionException
, DuplicateTaskException
,
StreamAlreadyDeployedException
, StreamAlreadyDeployingException
,
StreamAlreadyDeployingException
, or ApiNotSupportedException
@ExceptionHandler(value={JobNotRestartableException.class,org.springframework.batch.core.launch.JobExecutionNotRunningException.class}) @ResponseStatus(value=UNPROCESSABLE_ENTITY) @ResponseBody public org.springframework.hateoas.mediatype.vnderrors.VndErrors onUnprocessableEntityException(Exception e)
e
- one of the exceptions, JobNotRestartableException
or
JobExecutionNotRunningException
@ExceptionHandler(value={NoSuchAuditRecordException.class,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,NoSuchStepExecutionException.class,NoSuchTaskBatchException.class,NoSuchAppException.class,NoSuchAppInstanceException.class,NoSuchScheduleException.class,NoSuchSchemaTargetException.class}) @ResponseStatus(value=NOT_FOUND) @ResponseBody public org.springframework.hateoas.mediatype.vnderrors.VndErrors onNotFoundException(Exception e)
e
- one of the exceptions, NoSuchAuditRecordException
,
NoSuchStreamDefinitionException
,
NoSuchAppRegistrationException
, NoSuchTaskDefinitionException
,
NoSuchTaskExecutionException
, NoSuchJobExecutionException
,
NoSuchJobInstanceException
, NoSuchJobException
,
NoSuchStepExecutionException
,
NoSuchAppException
,
NoSuchAppInstanceException
, or
NoSuchSchemaTargetException
@ExceptionHandler(value={ApiNotSupportedException.class,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,InvalidDateRangeException.class,CannotDeleteNonParentTaskExecutionException.class,InvalidStreamDefinitionException.class,org.springframework.cloud.deployer.spi.scheduler.CreateScheduleException.class,OffsetOutOfBoundsException.class,TaskExecutionMissingExternalIdException.class,TaskQueryParamException.class,InvalidApplicationNameException.class}) @ResponseStatus(value=BAD_REQUEST) @ResponseBody public org.springframework.hateoas.mediatype.vnderrors.VndErrors onClientGenericBadRequest(Exception e)
e
- one of the exceptions, MissingServletRequestParameterException
,
UnsatisfiedServletRequestParameterException
,
MethodArgumentTypeMismatchException
, InvalidStreamDefinitionException
or
InvalidApplicationNameException
@ExceptionHandler(value=javax.validation.ConstraintViolationException.class) @ResponseStatus(value=BAD_REQUEST) @ResponseBody public org.springframework.hateoas.mediatype.vnderrors.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 © 2023 Pivotal Software, Inc.. All rights reserved.