提交 13871132 编写于 作者: T terrymanu

update AbstractBackendHandler.findSQLException

上级 6482843f
......@@ -47,6 +47,9 @@ public abstract class AbstractBackendHandler implements BackendHandler {
protected abstract CommandResponsePackets execute0() throws Exception;
private Optional<SQLException> findSQLException(final Exception exception) {
if (exception instanceof SQLException) {
return Optional.of((SQLException) exception);
}
if (null == exception.getCause()) {
return Optional.absent();
}
......@@ -57,7 +60,7 @@ public abstract class AbstractBackendHandler implements BackendHandler {
return Optional.absent();
}
if (exception.getCause().getCause() instanceof SQLException) {
return Optional.of((SQLException) exception.getCause());
return Optional.of((SQLException) exception.getCause().getCause());
}
return Optional.absent();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册