Class ProblemExceptionHandler
java.lang.Object
io.github.belgif.rest.problem.spring.ProblemExceptionHandler
@RestControllerAdvice
@ConditionalOnWebApplication
public class ProblemExceptionHandler
extends Object
Exception handler for RestControllers.
Handles the response serialization for Problem exceptions, and converts all other uncaught exceptions to an InternalServerErrorProblem.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity
<Problem> handleException
(Exception exception) org.springframework.http.ResponseEntity
<Problem> handleProblem
(Problem problem)
-
Constructor Details
-
ProblemExceptionHandler
public ProblemExceptionHandler()
-
-
Method Details
-
handleProblem
@ExceptionHandler(Problem.class) public org.springframework.http.ResponseEntity<Problem> handleProblem(Problem problem) -
handleException
@ExceptionHandler(java.lang.Exception.class) public org.springframework.http.ResponseEntity<Problem> handleException(Exception exception)
-