Class ExceptionWrapper

java.lang.Object
overit.geocall.util.ExceptionWrapper
All Implemented Interfaces:
HtmlText

public class ExceptionWrapper extends Object implements HtmlText
This class wraps an Exception adding some utility to transform the stacktrace into simple text rather than html compliant string.
  • Field Details

    • _exception

      protected final Exception _exception
    • _traceLimit

      protected final int _traceLimit
  • Constructor Details

    • ExceptionWrapper

      public ExceptionWrapper(Exception e)
      Creates the ExceptionWrapper starting from the Exception to wrap
      Parameters:
      e - exception to wrap
    • ExceptionWrapper

      public ExceptionWrapper(Exception e, int traceLimit)
      Creates the ExceptionWrapper starting from the Exception to wrap and the limit on the exception's causes that will be added to the result
      Parameters:
      e - exception to wrap
      traceLimit - Maximum number of exception's cause that will be added to the toString() or toHtml() result.
  • Method Details

    • getException

      public Exception getException()
      Returns the wrapped Exception
      Returns:
      The exception
    • toString

      public String toString()
      Returns the string representation of the Exception wrapped
      Overrides:
      toString in class Object
      Returns:
      The string that represents the exception
    • toHtml

      public String toHtml()
      Returns the html representation of the Exception wrapped
      Specified by:
      toHtml in interface HtmlText
      Returns:
      The string that contains the html code that represents the exception