Skip to content

Commit 7934090

Browse files
committed
fix: incorrect sentry initialization
1 parent deb5bae commit 7934090

File tree

4 files changed

+6
-16
lines changed

4 files changed

+6
-16
lines changed

lib/bootstrap.dart

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,6 @@ Future<void> bootstrap(
3939
SettingsBloc settingsBloc,
4040
) builder,
4141
) async {
42-
final widgetFlutterBindingSpan = span.startChild(
43-
'initialize SentryWidgetsFlutterBinding',
44-
description: 'calls SentryWidgetsFlutterBinding.ensureInitialized()',
45-
);
46-
47-
// Ensure SentryWidgetsFlutterBinding is initialized
48-
try {
49-
SentryWidgetsFlutterBinding.ensureInitialized();
50-
} catch (e) {
51-
widgetFlutterBindingSpan
52-
..throwable = e
53-
..status = const SpanStatus.notFound();
54-
} finally {
55-
await widgetFlutterBindingSpan.finish();
56-
}
57-
5842
FlutterError.onError = (details) {
5943
Sentry.captureException(
6044
details,

lib/main_development.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Future<void> main() async {
99
// Read .env file
1010
await dotenv.load(fileName: 'assets/.env');
1111

12+
SentryWidgetsFlutterBinding.ensureInitialized();
13+
1214
await SentryFlutter.init(
1315
(options) {
1416
options

lib/main_production.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Future<void> main() async {
99
// Read .env file
1010
await dotenv.load(fileName: 'assets/.env');
1111

12+
SentryWidgetsFlutterBinding.ensureInitialized();
13+
1214
await SentryFlutter.init(
1315
(options) {
1416
options

lib/main_staging.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Future<void> main() async {
99
// Read .env file
1010
await dotenv.load(fileName: 'assets/.env');
1111

12+
SentryWidgetsFlutterBinding.ensureInitialized();
13+
1214
await SentryFlutter.init(
1315
(options) {
1416
options

0 commit comments

Comments
 (0)