Package scriptella.spi
Class ProviderException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
scriptella.core.SystemException
scriptella.spi.ProviderException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
CsvProviderException,JaninoProviderException,JdbcException,JexlProviderException,LdapProviderException,MailProviderException,ScriptProviderException,ShellProviderException,TextProviderException,VelocityProviderException,XPathProviderException
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 Summary
ConstructorsConstructorDescriptionProviderException(String message) ProviderException(String message, Throwable cause) ProviderException(Throwable cause) -
Method Summary
Modifier and TypeMethodDescriptionaddErrorCode(String errorCode) Adds error code to this exception.Returns error codes attached to this exception.Returns a statement for this error if any.This method should be overriden by providers relying on external APIs to work with connections.abstract StringOverriden by subclasses to provide user friendly provider name.protected ProviderExceptionsetErrorStatement(String errStmt) Sets problem statement which caused this exception/toString()Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
Constructor Details
-
ProviderException
public ProviderException() -
ProviderException
-
ProviderException
-
ProviderException
-
-
Method Details
-
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
Adds error code to this exception.- Parameters:
errorCode- vendor specific error code.- Returns:
- this exception for convenience.
-
setErrorStatement
Sets problem statement which caused this exception/- Parameters:
errStmt- statement text.- Returns:
- this exception for convenience.
-
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
Returns a statement for this error if any.- Returns:
- statement text and additional data.
-
getProviderName
Overriden by subclasses to provide user friendly provider name.- Returns:
- provider name.
-
toString
-