In my REST service app, I am planning to create a @ControllerAdvice
class to catch controller thrown exceptions and return ResponseEntity
objects accor
An implementation of the ErrorController
is used to provide a custom whitelabel error page.
A class annotated with @ControllerAdvise
is used to add a global exception handling logic for the whole application. Thus, more than one controller in your application.
If in your application there is no mapping found for a request or page then spring will fallback to the 'whitelabel error page'. And in this case it will be the custom implementation of ErrorController