Class GlobalExceptionHandler


  • @ControllerAdvice
    public class GlobalExceptionHandler
    extends Object
    Global exception handler that catches all errors and logs the interesting ones
    Author:
    Patrick Ehlert Created on 18 nov 2019
    • Constructor Detail

      • GlobalExceptionHandler

        public GlobalExceptionHandler()
    • Method Detail

      • handleApiKeyException

        @ExceptionHandler(ApiKeyException.class)
        public void handleApiKeyException​(javax.servlet.http.HttpServletResponse response,
                                          ApiKeyException e)
                                   throws ApiKeyException
        Checks if we should log an error (and its stacktrace) and rethrows it
        Parameters:
        e - caught exception
        Throws:
        ApiKeyException - rethrown exception