2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-12 02:05:29 +00:00

Simplify DSN file (#475)

* Add checks for empty sentry DSN

* Add default DSN key

* Fix CI workflows
This commit is contained in:
Oliver
2024-03-06 21:09:06 +11:00
committed by GitHub
parent a889c4adbe
commit b02dc5bac7
8 changed files with 25 additions and 16 deletions

View File

@ -34,13 +34,15 @@ Future<void> main() async {
String release = "${pkg}@${version}:${build}";
await Sentry.init((options) {
options.dsn = SENTRY_DSN_KEY;
options.release = release;
options.environment = isInDebugMode() ? "debug" : "release";
options.diagnosticLevel = SentryLevel.debug;
options.attachStacktrace = true;
});
if (SENTRY_DSN_KEY.isNotEmpty) {
await Sentry.init((options) {
options.dsn = SENTRY_DSN_KEY;
options.release = release;
options.environment = isInDebugMode() ? "debug" : "release";
options.diagnosticLevel = SentryLevel.debug;
options.attachStacktrace = true;
});
}
// Pass any flutter errors off to the Sentry reporting context!
FlutterError.onError = (FlutterErrorDetails details) async {