Module jp.ecuacion.splib.web
Class SplibExceptionHandler
java.lang.Object
jp.ecuacion.splib.web.exceptionhandler.SplibExceptionHandler
Provides an exception handler.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected SplibGeneralController<?> Returns the controller from which the exception throws.org.springframework.web.servlet.ModelAndViewhandleAppException(jp.ecuacion.lib.core.exception.checked.AppException exception, org.springframework.security.core.userdetails.UserDetails loginUser) CatchesAppException.org.springframework.web.servlet.ModelAndViewhandleAppWarningException(WebAppWarningException exception, org.springframework.security.core.userdetails.UserDetails loginUser) CatchesAppWarningException.org.springframework.web.servlet.ModelAndViewhandleExceptionsWhichLeadsToDefaultPage(Exception exception) Catches some specific exceptions.org.springframework.web.servlet.ModelAndViewhandleOptimisticLockingFailureException(OverlappingFileLockException exception, org.springframework.security.core.userdetails.UserDetails loginUser) CatchesOverlappingFileLockException.org.springframework.web.servlet.ModelAndViewhandleThrowable(Throwable exception, org.springframework.ui.Model model) CatchesThrowable.
-
Constructor Details
-
SplibExceptionHandler
public SplibExceptionHandler()
-
-
Method Details
-
getController
Returns the controller from which the exception throws.- Returns:
- SplibGeneralController
-
handleAppWarningException
@ExceptionHandler(jp.ecuacion.lib.core.exception.checked.AppWarningException.class) @Nonnull public org.springframework.web.servlet.ModelAndView handleAppWarningException(@Nonnull WebAppWarningException exception, @Nullable @AuthenticationPrincipal org.springframework.security.core.userdetails.UserDetails loginUser) throws Exception CatchesAppWarningException.- Parameters:
exception- AppWarningExceptionloginUser- UserDetails, may benullwhen the user is not logged in- Returns:
- ModelAndView
- Throws:
Exception- Exception
-
handleAppException
@ExceptionHandler(jp.ecuacion.lib.core.exception.checked.AppException.class) @Nonnull public org.springframework.web.servlet.ModelAndView handleAppException(@Nonnull jp.ecuacion.lib.core.exception.checked.AppException exception, @Nullable @AuthenticationPrincipal org.springframework.security.core.userdetails.UserDetails loginUser) throws Exception CatchesAppException.- Parameters:
exception- AppExceptionloginUser- UserDetails- Returns:
- ModelAndView
- Throws:
Exception- Exception
-
handleOptimisticLockingFailureException
@ExceptionHandler(java.nio.channels.OverlappingFileLockException.class) @Nonnull public org.springframework.web.servlet.ModelAndView handleOptimisticLockingFailureException(@Nonnull OverlappingFileLockException exception, @Nullable @AuthenticationPrincipal org.springframework.security.core.userdetails.UserDetails loginUser) throws Exception CatchesOverlappingFileLockException.- Parameters:
exception- AppExceptionloginUser- UserDetails- Returns:
- ModelAndView
- Throws:
Exception- Exception
-
handleExceptionsWhichLeadsToDefaultPage
@ExceptionHandler({HtmlFileNotFoundException.class,HtmlFileNotAllowedToOpenException.class}) @Nonnull public org.springframework.web.servlet.ModelAndView handleExceptionsWhichLeadsToDefaultPage(@Nonnull Exception exception) Catches some specific exceptions.- Parameters:
exception- Exception- Returns:
- ModelAndView
-
handleThrowable
@ExceptionHandler(java.lang.Throwable.class) @Nonnull public org.springframework.web.servlet.ModelAndView handleThrowable(@Nonnull Throwable exception, @Nonnull org.springframework.ui.Model model) CatchesThrowable.- Parameters:
exception- Throwablemodel- model- Returns:
- ModelAndView
-