mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
add error info
This commit is contained in:
@@ -1025,15 +1025,27 @@ public class DruidPooledConnection extends PoolableWrapper implements javax.sql.
|
||||
|
||||
public void checkState() throws SQLException {
|
||||
if (holder == null) {
|
||||
throw new SQLException("connection holder is null");
|
||||
if (disableError != null) {
|
||||
throw new SQLException("connection holder is null", disableError);
|
||||
} else {
|
||||
throw new SQLException("connection holder is null");
|
||||
}
|
||||
}
|
||||
|
||||
if (closed) {
|
||||
throw new SQLException("connection closed");
|
||||
if (disableError != null) {
|
||||
throw new SQLException("connection closed", disableError);
|
||||
} else {
|
||||
throw new SQLException("connection closed");
|
||||
}
|
||||
}
|
||||
|
||||
if (disable) {
|
||||
throw new SQLException("connection disabled", disableError);
|
||||
if (disableError != null) {
|
||||
throw new SQLException("connection disabled", disableError);
|
||||
} else {
|
||||
throw new SQLException("connection disabled");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user