Class ExceptionController
java.lang.Object
org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
tech.corefinance.common.controller.ExceptionController
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.context.MessageSourceAware
@ControllerAdvice
@ResponseBody
@RequestMapping(produces="application/json")
@ResponseStatus(code=INTERNAL_SERVER_ERROR)
public class ExceptionController
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 TypeMethodDescriptiontech.corefinance.common.dto.GeneralApiResponse<String>accessDenied(org.springframework.security.access.AccessDeniedException e) tech.corefinance.common.dto.GeneralApiResponse<String>handleProcessingException(jakarta.servlet.http.HttpServletRequest request, Exception e) handleResourceNotFound(jakarta.servlet.http.HttpServletRequest request, Exception e) tech.corefinance.common.dto.GeneralApiResponse<String>Methods inherited from class org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
createProblemDetail, createResponseEntity, getMessageSource, handleAsyncRequestTimeoutException, handleBindException, handleConversionNotSupported, handleErrorResponseException, handleException, handleExceptionInternal, handleHttpMediaTypeNotAcceptable, handleHttpMediaTypeNotSupported, handleHttpMessageNotReadable, handleHttpMessageNotWritable, handleHttpRequestMethodNotSupported, handleMethodArgumentNotValid, handleMissingPathVariable, handleMissingServletRequestParameter, handleMissingServletRequestPart, handleNoHandlerFoundException, handleServletRequestBindingException, handleTypeMismatch, setMessageSource
-
Constructor Details
-
ExceptionController
public ExceptionController()
-
-
Method Details
-
handleProcessingException
@ExceptionHandler(ServiceProcessingException.class) @ResponseStatus(code=BAD_REQUEST) public Object handleProcessingException(jakarta.servlet.http.HttpServletRequest request, Exception e) -
handleJsonException
@ExceptionHandler({javax.xml.parsers.ParserConfigurationException.class,com.fasterxml.jackson.core.JsonProcessingException.class}) @ResponseStatus(code=BAD_REQUEST) public String handleJsonException(Exception e) -
accessDenied
@ExceptionHandler(org.springframework.security.access.AccessDeniedException.class) @ResponseStatus(FORBIDDEN) public tech.corefinance.common.dto.GeneralApiResponse<String> accessDenied(org.springframework.security.access.AccessDeniedException e) -
badRequest
@ExceptionHandler({java.lang.IllegalArgumentException.class,jakarta.validation.ConstraintViolationException.class}) @ResponseStatus(BAD_REQUEST) public tech.corefinance.common.dto.GeneralApiResponse<String> badRequest(Exception e) -
internalServerError
@ExceptionHandler(java.lang.Throwable.class) public tech.corefinance.common.dto.GeneralApiResponse<String> internalServerError(Throwable e) -
handleResourceNotFound
@ExceptionHandler(ResourceNotFound.class) @ResponseStatus(code=NOT_FOUND) public Object handleResourceNotFound(jakarta.servlet.http.HttpServletRequest request, Exception e)
-