Class DefaultExceptionMapper

  • All Implemented Interfaces:
    org.apache.wicket.request.IExceptionMapper

    public class DefaultExceptionMapper
    extends Object
    implements org.apache.wicket.request.IExceptionMapper
    If an exception is thrown when a page is being rendered this mapper will decide which error page to show depending on the exception type and application configuration
    • Method Detail

      • map

        public org.apache.wicket.request.IRequestHandler map​(Exception e)
        Specified by:
        map in interface org.apache.wicket.request.IExceptionMapper
      • handleNestedException

        protected org.apache.wicket.request.IRequestHandler handleNestedException​(Exception originalException,
                                                                                  RuntimeException nestedException)
        Handles the case when an exception is generated while mapping the original exception happened
        Parameters:
        originalException - The original exception.
        nestedException - The nested (second) exception produced
        Returns:
        IRequestHandler (by default ErrorCodeRequestHandler
      • mapExpectedExceptions

        protected org.apache.wicket.request.IRequestHandler mapExpectedExceptions​(Exception e,
                                                                                  Application application)
        Maps expected exceptions (i.e. those internally used by Wicket) to their corresponding IRequestHandler.
        Parameters:
        e - the current exception
        application - the current application object
        Returns:
        the IRequestHandler for the current exception
      • mapUnexpectedExceptions

        protected org.apache.wicket.request.IRequestHandler mapUnexpectedExceptions​(Exception e,
                                                                                    Application application)
        Maps unexpected exceptions to their corresponding IRequestHandler.
        Parameters:
        e - the current exception
        application - the current application object
        Returns:
        the IRequestHandler for the current exception
      • isProcessingAjaxRequest

        protected boolean isProcessingAjaxRequest()
        Returns:
        true if current request is an AJAX request, false otherwise.
      • extractCurrentPage

        protected Page extractCurrentPage()
        Returns:
        the page being rendered when the exception was thrown, or null if it cannot be extracted