com.axibase.tsd.driver.jdbc.util.ExceptionsUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of atsd-jdbc Show documentation
Show all versions of atsd-jdbc Show documentation
JDBC driver for SQL API using
package com.axibase.tsd.driver.jdbc.util;
import java.sql.SQLException;
import com.axibase.tsd.driver.jdbc.ext.AtsdRuntimeException;
public class ExceptionsUtil {
private ExceptionsUtil() {}
public static SQLException unboxException(SQLException exception) {
final Throwable cause = exception.getCause();
if (cause == null || !(cause instanceof RuntimeException)) {
return exception;
}
Throwable finalCause = exception;
if (cause instanceof AtsdRuntimeException) {
Throwable inner = cause.getCause();
if (inner instanceof SQLException) { // parsed result from ATSD
finalCause = cause;
}
}
SQLException result = new SQLException(exception.getMessage(), finalCause);
return result;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy