Class ProviderException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
CsvProviderException, JaninoProviderException, JdbcException, JexlProviderException, LdapProviderException, MailProviderException, ScriptProviderException, ShellProviderException, TextProviderException, VelocityProviderException, XPathProviderException

public abstract class ProviderException extends SystemException
Thrown by connection provider to indicate any kind of failure.

Service Providers must provide subclasses of this exception.

Version:
1.0
Author:
Fyodor Kupolov
See Also:
  • Constructor Details

    • ProviderException

      public ProviderException()
    • ProviderException

      public ProviderException(String message)
    • ProviderException

      public ProviderException(String message, Throwable cause)
    • ProviderException

      public ProviderException(Throwable cause)
  • Method Details

    • getErrorCodes

      public Set<String> getErrorCodes()
      Returns error codes attached to this exception. For example JDBC drivers reports 2 error codes: SQLSTATE and vendor code.

      Do not use ", . ;" in error codes.

      Returns:
      set of error codes.
    • addErrorCode

      public ProviderException addErrorCode(String errorCode)
      Adds error code to this exception.
      Parameters:
      errorCode - vendor specific error code.
      Returns:
      this exception for convenience.
    • setErrorStatement

      protected ProviderException setErrorStatement(String errStmt)
      Sets problem statement which caused this exception/
      Parameters:
      errStmt - statement text.
      Returns:
      this exception for convenience.
    • getNativeException

      public Throwable getNativeException()
      This method should be overriden by providers relying on external APIs to work with connections. Used only for informative error reporting.

      Examples: SQL Exceptions, LDAP connection exceptions etc.

      Returns:
      external API throwable wich may be important for user to recognize the problem.
    • getErrorStatement

      public String getErrorStatement()
      Returns a statement for this error if any.
      Returns:
      statement text and additional data.
    • getProviderName

      public abstract String getProviderName()
      Overriden by subclasses to provide user friendly provider name.
      Returns:
      provider name.
    • toString

      public String toString()
      Overrides:
      toString in class Throwable