mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-01 15:36:45 +00:00
don't send json and zip file closed exceptions to sentry
This commit is contained in:
parent
ed67b4d3c2
commit
37be7ca847
@ -53,6 +53,7 @@ import com.volmit.iris.util.io.FileWatcher;
|
||||
import com.volmit.iris.util.io.IO;
|
||||
import com.volmit.iris.util.io.InstanceState;
|
||||
import com.volmit.iris.util.io.JarScanner;
|
||||
import com.volmit.iris.util.json.JSONException;
|
||||
import com.volmit.iris.util.math.M;
|
||||
import com.volmit.iris.util.math.RNG;
|
||||
import com.volmit.iris.util.misc.getHardware;
|
||||
@ -947,6 +948,10 @@ public class Iris extends VolmitPlugin implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean suppress(Throwable e) {
|
||||
return (e instanceof IllegalStateException ex && "zip file closed".equals(ex.getMessage())) || e instanceof JSONException;
|
||||
}
|
||||
|
||||
private static void setupSentry() {
|
||||
var settings = IrisSettings.get().getSentry();
|
||||
if (settings.disableAutoReporting || Sentry.isEnabled()) return;
|
||||
@ -962,6 +967,7 @@ public class Iris extends VolmitPlugin implements Listener {
|
||||
options.setEnableUncaughtExceptionHandler(false);
|
||||
options.setRelease(Iris.instance.getDescription().getVersion());
|
||||
options.setBeforeSend((event, hint) -> {
|
||||
if (suppress(event.getThrowable())) return null;
|
||||
event.setTag("iris.safeguard", IrisSafeguard.mode());
|
||||
event.setTag("iris.nms", INMS.get().getClass().getCanonicalName());
|
||||
var context = IrisContext.get();
|
||||
|
Loading…
x
Reference in New Issue
Block a user