* @return translated exception
*/
@Override
protected SQLException translateException(Exception e) {
if (e.getCause() instanceof BitronixRuntimeException) {
BitronixRuntimeException cause = (BitronixRuntimeException) e.getCause();
if (cause.getMessage() != null &&
Pattern.matches(ACQUIRE_TIMEOUT_MESSAGE, cause.getMessage())) {
return new AcquireTimeoutException(e);
}
} else if (e instanceof SQLException) {
return (SQLException) e;
}