#10914 integrate crash reporting
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:checker/db.dart';
|
||||
import 'package:checker/strings.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:checker/screens/splash.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:sentry/sentry.dart';
|
||||
|
||||
const platform = const MethodChannel('com.dinect.checker/instance_id');
|
||||
|
||||
@@ -50,8 +53,23 @@ createSettingsTable(String app, String name, SqliteHelper helper) {
|
||||
}
|
||||
|
||||
start(String app, String name, String locale, SqliteHelper helper) {
|
||||
final SentryClient sentry = new SentryClient(
|
||||
dsn: 'https://42166056b75d4fe49455555a9bc576a0@sentry.io/1376057');
|
||||
|
||||
FlutterError.onError = (FlutterErrorDetails details) {
|
||||
FlutterError.dumpErrorToConsole(details);
|
||||
Zone.current.handleUncaughtError(details.exception, details.stack);
|
||||
};
|
||||
|
||||
StringsLocalization.load(locale).then((_) {
|
||||
runApp(new Checker(app, name, helper));
|
||||
runZoned<Future<Null>>(() async {
|
||||
runApp(new Checker(app, name, helper));
|
||||
}, onError: (error, stackTrace) async {
|
||||
sentry.captureException(
|
||||
exception: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user