9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2026-01-04 15:41:38 +00:00

处理空包异常

This commit is contained in:
XiaoMoMi
2025-05-31 16:08:52 +08:00
parent 035cfcc336
commit 71b0322990
4 changed files with 36 additions and 7 deletions

View File

@@ -0,0 +1,15 @@
package net.momirealms.craftengine.core.util;
public final class ExceptionUtils {
private ExceptionUtils() {}
public static boolean hasException(Throwable t, Exception e) {
while (t != null) {
if (t == e) {
return true;
}
t = t.getCause();
}
return false;
}
}