Class ExceptionErrorPage

All Implemented Interfaces:
Serializable, Iterable<Component>, IEventSink, IEventSource, IFeedbackContributor, IConverterLocator, IMetadataContext<Serializable,Component>, IQueueRegion, IHeaderContributor, IManageablePage, IRequestableComponent, IRequestablePage, IHierarchical<Component>, IClusterable

Shows a runtime exception on a nice HTML page.
Author:
Jonathan Locke
See Also:
  • Constructor Details

    • ExceptionErrorPage

      public ExceptionErrorPage(Throwable throwable, Page page)
      Constructor.
      Parameters:
      throwable - The exception to show
      page - The page being rendered when the exception was thrown
  • Method Details

    • getErrorMessage

      public String getErrorMessage(Throwable throwable)
      Converts a Throwable to a string.
      Parameters:
      throwable - The throwable
      Returns:
      The string
    • getStackTrace

      public String getStackTrace(Throwable throwable)
      Converts a Throwable to a string.
      Parameters:
      throwable - The throwable
      Returns:
      The string
    • setHeaders

      protected void setHeaders(WebResponse response)
      Description copied from class: WebPage
      Subclasses can override this to set there headers when the Page is being served. By default these headers are set:
       response.setHeader("Date", "[now]");
       response.setHeader("Expires", "[0]");
       response.setHeader("Pragma", "no-cache");
       response.setHeader("Cache-Control", "no-cache");
       
      So if a Page wants to control this or doesn't want to set this info it should override this method and don't call super.
      Overrides:
      setHeaders in class WebPage
      Parameters:
      response - The WebResponse where set(Date)Header can be called on.
    • getThrowable

      Get access to the exception
      Returns:
      The exception