sentry changes

- info message on enabling
- add release tag
- disable uncaught exception handling to prevent reporting other plugins issues
This commit is contained in:
Julian Krings 2025-06-08 12:29:24 +02:00
parent b66e6d8335
commit 8119207254
No known key found for this signature in database
GPG Key ID: 208C6E08C3B718D2
2 changed files with 10 additions and 4 deletions

View File

@ -490,8 +490,6 @@ public class Iris extends VolmitPlugin implements Listener {
checkForBukkitWorlds();
IrisToolbelt.retainMantleDataForSlice(String.class.getCanonicalName());
IrisToolbelt.retainMantleDataForSlice(BlockData.class.getCanonicalName());
reportError(new Exception("This is a test"));
});
}
@ -533,7 +531,7 @@ public class Iris extends VolmitPlugin implements Listener {
}
} catch (Throwable e) {
e.printStackTrace();
Sentry.captureException(e);
reportError(e);
}
}
@ -551,7 +549,7 @@ public class Iris extends VolmitPlugin implements Listener {
});
});
} catch (IrisException e) {
Sentry.captureException(e);
reportError(e);
}
}
}
@ -951,6 +949,7 @@ public class Iris extends VolmitPlugin implements Listener {
private static void setupSentry() {
var settings = IrisSettings.get().getSentry();
if (settings.disableAutoReporting || Sentry.isEnabled()) return;
Iris.info("Enabling Sentry for anonymous error reporting. You can disable this in the settings.");
Sentry.init(options -> {
options.setDsn("https://b16ecc222e9c1e0c48faecacb906fd89@o4509451052646400.ingest.de.sentry.io/4509452722765904");
if (settings.debug) {
@ -958,6 +957,8 @@ public class Iris extends VolmitPlugin implements Listener {
options.setDebug(true);
}
options.setEnableUncaughtExceptionHandler(false);
options.setRelease(Iris.instance.getDescription().getVersion());
options.setBeforeSend((event, hint) -> {
event.setTag("iris.safeguard", IrisSafeguard.mode());
event.setTag("iris.nms", INMS.get().getClass().getCanonicalName());

View File

@ -71,6 +71,11 @@ public class CommandDeveloper implements DecreeExecutor {
.engineStatus(sender());
}
@Decree(description = "Send a test exception to sentry")
public void Sentry() {
Iris.reportError(new Exception("This is a test"));
}
@Decree(description = "Test")
public void dumpThreads() {
try {