1
mirror of https://github.com/CarmJos/EasySQL.git synced 2026-06-04 15:28:20 +08:00

[v0.2.9] [A] 添加自定义默认异常处理器的方法。

This commit is contained in:
2022-01-24 15:53:07 +08:00
parent 360b416525
commit a8a475fc7a
4 changed files with 51 additions and 19 deletions
@@ -8,8 +8,8 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.sql.SQLException;
import java.util.Optional;
import java.util.UUID;
import java.util.function.BiConsumer;
public abstract class AbstractSQLAction<T> implements SQLAction<T> {
@@ -20,7 +20,7 @@ public abstract class AbstractSQLAction<T> implements SQLAction<T> {
protected @NotNull String sqlContent;
protected @Nullable BiConsumer<SQLException, SQLAction<T>> exceptionHandler = null;
protected static @Nullable SQLExceptionHandler exceptionHandler = null;
public AbstractSQLAction(@NotNull SQLManagerImpl manager, @NotNull String sql) {
this(manager, sql, System.currentTimeMillis());
@@ -70,7 +70,7 @@ public class SQLQueryImpl implements SQLQuery {
);
getManager().getActiveQuery().remove(getAction().getActionUUID());
} catch (SQLException e) {
getAction().handleException(getAction().getExceptionHandler(), e);
getAction().handleException(getAction().defaultExceptionHandler(), e);
}
this.queryAction = null;
}