fix: Sentry
This commit is contained in:
parent
a99af4a9f0
commit
e34e252be2
4 changed files with 22 additions and 19 deletions
|
|
@ -1,7 +1,9 @@
|
|||
import 'package:bot_toast/bot_toast.dart';
|
||||
import 'package:fluffychat/components/dialogs/simple_dialogs.dart';
|
||||
import 'package:fluffychat/config/app_config.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:sentry/sentry.dart';
|
||||
|
||||
import 'famedlysdk_store.dart';
|
||||
|
||||
|
|
@ -23,4 +25,18 @@ abstract class SentryController {
|
|||
final storage = Store();
|
||||
return await storage.getItem('sentry') == 'true';
|
||||
}
|
||||
|
||||
static final sentry = SentryClient(dsn: AppConfig.sentryDsn);
|
||||
|
||||
static void captureException(error, stackTrace) async {
|
||||
debugPrint(error.toString());
|
||||
debugPrint(stackTrace.toString());
|
||||
final storage = Store();
|
||||
if (await storage.getItem('sentry') == 'true') {
|
||||
await sentry.captureException(
|
||||
exception: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue