mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-28 01:45:55 +08:00
Very basic sentry integration
This commit is contained in:
@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/foundation.dart' as foundation;
|
||||
|
||||
import 'package:flutter_crashlytics/flutter_crashlytics.dart';
|
||||
import 'package:sentry/sentry.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import 'package:gitjournal/app.dart';
|
||||
@ -32,12 +33,19 @@ void main() async {
|
||||
await FlutterCrashlytics().initialize();
|
||||
}
|
||||
|
||||
var sentry = SentryClient(
|
||||
dsn: 'https://35f34dbec289435fbe16483faacf49a5@sentry.io/5168082',
|
||||
);
|
||||
|
||||
runZoned<Future<void>>(() async {
|
||||
await JournalApp.main(pref);
|
||||
}, onError: (Object error, StackTrace stackTrace) async {
|
||||
print("Uncaught Exception: " + error.toString());
|
||||
print(stackTrace);
|
||||
await FlutterCrashlytics()
|
||||
.reportCrash(error, stackTrace, forceCrash: false);
|
||||
FlutterCrashlytics().reportCrash(error, stackTrace, forceCrash: false);
|
||||
sentry.captureException(
|
||||
exception: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
14
pubspec.lock
14
pubspec.lock
@ -544,6 +544,13 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.1"
|
||||
sentry:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: sentry
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.0.1"
|
||||
share:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -745,6 +752,13 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.1.0+2"
|
||||
usage:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: usage
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.4.1"
|
||||
uuid:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
@ -39,6 +39,7 @@ dependencies:
|
||||
synchronized: ^2.2.0
|
||||
steel_crypt: ^1.7.1+1
|
||||
font_awesome_flutter: ^8.7.0
|
||||
sentry: ">=3.0.0 <4.0.0"
|
||||
|
||||
dev_dependencies:
|
||||
flutter_launcher_icons: "^0.7.2"
|
||||
|
Reference in New Issue
Block a user