Skip to content

Instantly share code, notes, and snippets.

@joergi
Last active November 30, 2017 14:17
Show Gist options
  • Save joergi/31cd6edbe70230e41a7972e633b7547e to your computer and use it in GitHub Desktop.
Save joergi/31cd6edbe70230e41a7972e633b7547e to your computer and use it in GitHub Desktop.
ErrorInterceptor.java should catch all exceptions as in an normalen https://spring.io/blog/2013/11/01/exception-handling-in-spring-mvc
package errortest.de.joergi.errors;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@ControllerAdvice
public class ErrorInterceptor {
@ExceptionHandler(Exception.class)
public void exceptionHandler() {
log.info("Exception was thrown");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment