Class BaseExceptionHandlerAdvice
java.lang.Object
org.flowable.common.rest.exception.BaseExceptionHandlerAdvice
Base class for ExceptionHandlerAdvice controllers From http://spring.io/blog/2013/11/01/exception-handling-in-spring-mvc
- Author:
- Tijs Rademakers
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.slf4j.Loggerprotected booleanFlag indicating whether to send the full error exception message for unknown exceptions. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionhandleBadMessageConversion(HttpMessageConversionException e, jakarta.servlet.http.HttpServletRequest request) handleConflict(FlowableConflictException e, jakarta.servlet.http.HttpServletRequest request) handleForbidden(FlowableForbiddenException e, jakarta.servlet.http.HttpServletRequest request) handleIllegalArgument(FlowableIllegalArgumentException e, jakarta.servlet.http.HttpServletRequest request) handleIllegalState(FlowableIllegalStateException e, jakarta.servlet.http.HttpServletRequest request) handleNotFound(FlowableObjectNotFoundException e, jakarta.servlet.http.HttpServletRequest request) handleNotSupported(FlowableContentNotSupportedException e, jakarta.servlet.http.HttpServletRequest request) handleOtherException(Exception e, jakarta.servlet.http.HttpServletRequest request) handleTaskAlreadyClaimed(FlowableTaskAlreadyClaimedException e, jakarta.servlet.http.HttpServletRequest request) booleanvoidsetSendFullErrorException(boolean sendFullErrorException)
-
Field Details
-
logger
protected final org.slf4j.Logger logger -
sendFullErrorException
protected boolean sendFullErrorExceptionFlag indicating whether to send the full error exception message for unknown exceptions. If set totrue, then theThrowable.getMessage()will be set on theErrorInfo.setException(String), otherwise a unique error identifier will be set and a message containing that identifier will be logged.
-
-
Constructor Details
-
BaseExceptionHandlerAdvice
public BaseExceptionHandlerAdvice()
-
-
Method Details
-
handleNotSupported
@ResponseStatus(UNSUPPORTED_MEDIA_TYPE) @ExceptionHandler(FlowableContentNotSupportedException.class) @ResponseBody public ErrorInfo handleNotSupported(FlowableContentNotSupportedException e, jakarta.servlet.http.HttpServletRequest request) -
handleConflict
@ResponseStatus(CONFLICT) @ExceptionHandler(FlowableConflictException.class) @ResponseBody public ErrorInfo handleConflict(FlowableConflictException e, jakarta.servlet.http.HttpServletRequest request) -
handleNotFound
@ResponseStatus(NOT_FOUND) @ExceptionHandler(FlowableObjectNotFoundException.class) @ResponseBody public ErrorInfo handleNotFound(FlowableObjectNotFoundException e, jakarta.servlet.http.HttpServletRequest request) -
handleForbidden
@ResponseStatus(FORBIDDEN) @ExceptionHandler(FlowableForbiddenException.class) @ResponseBody public ErrorInfo handleForbidden(FlowableForbiddenException e, jakarta.servlet.http.HttpServletRequest request) -
handleIllegalArgument
@ResponseStatus(BAD_REQUEST) @ExceptionHandler(FlowableIllegalArgumentException.class) @ResponseBody public ErrorInfo handleIllegalArgument(FlowableIllegalArgumentException e, jakarta.servlet.http.HttpServletRequest request) -
handleIllegalState
@ResponseStatus(BAD_REQUEST) @ExceptionHandler(FlowableIllegalStateException.class) @ResponseBody public ErrorInfo handleIllegalState(FlowableIllegalStateException e, jakarta.servlet.http.HttpServletRequest request) -
handleBadMessageConversion
@ResponseStatus(BAD_REQUEST) @ExceptionHandler(org.springframework.http.converter.HttpMessageConversionException.class) @ResponseBody public ErrorInfo handleBadMessageConversion(HttpMessageConversionException e, jakarta.servlet.http.HttpServletRequest request) -
handleTaskAlreadyClaimed
@ResponseStatus(CONFLICT) @ExceptionHandler(FlowableTaskAlreadyClaimedException.class) @ResponseBody public ErrorInfo handleTaskAlreadyClaimed(FlowableTaskAlreadyClaimedException e, jakarta.servlet.http.HttpServletRequest request) -
handleOtherException
@ResponseStatus(INTERNAL_SERVER_ERROR) @ExceptionHandler(java.lang.Exception.class) @ResponseBody public ErrorInfo handleOtherException(Exception e, jakarta.servlet.http.HttpServletRequest request) -
isSendFullErrorException
public boolean isSendFullErrorException() -
setSendFullErrorException
public void setSendFullErrorException(boolean sendFullErrorException)
-