Class BaseExceptionAdvice

java.lang.Object
info.ejava.examples.common.web.BaseExceptionAdvice
Direct Known Subclasses:
ExceptionAdvice, ExceptionAdvice, ExceptionAdvice, ExceptionAdvice, ExceptionAdvice, ExceptionAdvice, ExceptionAdvice, ExceptionAdvice, HousesExceptionAdvice, RentersExceptionAdvice

public class BaseExceptionAdvice extends Object
This class provide custom error handling for exceptions thrown by the controller. It is one of several techniques offered by Spring and selected primarily because we retain full control over the response and response headers returned to the caller. Extend this class and declare the @RestController on the child class in your module:

   @RestControllerAdvice(assignableTypes = MyController.class)
   public class MyExceptionAdvice extends BaseExceptionAdvice {}
   
.