public class ExceptionMapper
extends java.lang.Object
Constructor and Description |
---|
ExceptionMapper() |
Modifier and Type | Method and Description |
---|---|
private static java.sql.SQLException |
get(java.lang.String message,
java.sql.SQLException exception,
boolean timeout) |
static java.sql.SQLException |
getException(java.sql.SQLException exception,
MariaDbConnection connection,
MariaDbStatement statement,
boolean timeout)
Helper to decorate exception with associate subclass of
SQLException exception. |
static java.sql.SQLException |
getFeatureNotSupportedException(java.lang.String message) |
static java.sql.SQLException |
getSqlException(java.lang.String message) |
static java.sql.SQLException |
getSqlException(java.lang.String message,
java.lang.Exception exception) |
static java.sql.SQLException |
getSqlException(java.lang.String message,
java.lang.String sqlState,
java.lang.Exception exception) |
static java.lang.String |
mapCodeToSqlState(int code)
Mapp code to State.
|
static void |
throwAndLogException(java.sql.SQLException exception,
MariaDbConnection connection,
MariaDbStatement statement,
Logger logger,
boolean timeout)
Helper to throw exception.
|
static void |
throwException(java.sql.SQLException exception,
MariaDbConnection connection,
MariaDbStatement statement)
Helper to throw exception.
|
public static void throwAndLogException(java.sql.SQLException exception, MariaDbConnection connection, MariaDbStatement statement, Logger logger, boolean timeout) throws java.sql.SQLException
exception
- exceptionconnection
- current connectionstatement
- current statementlogger
- loggertimeout
- was timeout on queryjava.sql.SQLException
- exceptionpublic static void throwException(java.sql.SQLException exception, MariaDbConnection connection, MariaDbStatement statement) throws java.sql.SQLException
exception
- exceptionconnection
- current connectionstatement
- current statementjava.sql.SQLException
- exceptionpublic static java.sql.SQLException getException(java.sql.SQLException exception, MariaDbConnection connection, MariaDbStatement statement, boolean timeout)
SQLException
exception.exception
- exceptionconnection
- current connectionstatement
- current statementtimeout
- was timeout on queryprivate static java.sql.SQLException get(java.lang.String message, java.sql.SQLException exception, boolean timeout)
public static java.sql.SQLException getSqlException(java.lang.String message, java.lang.Exception exception)
public static java.sql.SQLException getSqlException(java.lang.String message, java.lang.String sqlState, java.lang.Exception exception)
public static java.sql.SQLException getSqlException(java.lang.String message)
public static java.sql.SQLException getFeatureNotSupportedException(java.lang.String message)
public static java.lang.String mapCodeToSqlState(int code)
code
- code