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