Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
- Use FFI/JNI for `captureEnvelope` on iOS and Android ([#3115](https://github.com/getsentry/sentry-dart/pull/3115))
- Log a warning when dropping envelope items ([#3165](https://github.com/getsentry/sentry-dart/pull/3165))
- Call options.log for structured logs ([#3187](https://github.com/getsentry/sentry-dart/pull/3187))
- Remove async usage from `FlutterErrorIntegration` ([#3202](https://github.com/getsentry/sentry-dart/pull/3202))
- Tag all spans during app start with start type info ([#3190](https://github.com/getsentry/sentry-dart/pull/3190))

### Dependencies
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:async';

import 'package:flutter/foundation.dart';
import 'package:sentry/sentry.dart';
import '../sentry_flutter_options.dart';
Expand All @@ -22,7 +24,7 @@ class FlutterErrorIntegration implements Integration<SentryFlutterOptions> {
@override
void call(Hub hub, SentryFlutterOptions options) {
_defaultOnError = FlutterError.onError;
_integrationOnError = (FlutterErrorDetails errorDetails) async {
_integrationOnError = (FlutterErrorDetails errorDetails) {
final exception = errorDetails.exception;

options.log(
Expand Down Expand Up @@ -88,7 +90,7 @@ class FlutterErrorIntegration implements Integration<SentryFlutterOptions> {
stackTrace = getCurrentStackTrace();
hint.addAll({TypeCheckHint.currentStackTrace: true});
}
await hub.captureEvent(event, stackTrace: stackTrace, hint: hint);
unawaited(hub.captureEvent(event, stackTrace: stackTrace, hint: hint));
// we don't call Zone.current.handleUncaughtError because we'd like
// to set a specific mechanism for FlutterError.onError.
} else {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:async';

import 'package:sentry/sentry.dart';
// ignore: implementation_imports
import 'package:sentry/src/utils/stacktrace_utils.dart';
Expand Down Expand Up @@ -83,8 +85,7 @@ class OnErrorIntegration implements Integration<SentryFlutterOptions> {
stackTrace = getCurrentStackTrace();
hint = Hint.withMap({TypeCheckHint.currentStackTrace: true});
}
// unawaited future
hub.captureEvent(event, stackTrace: stackTrace, hint: hint);
unawaited(hub.captureEvent(event, stackTrace: stackTrace, hint: hint));

return handled;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ void main() {
_mockValues();

// replace default error otherwise it fails on testing
FlutterError.onError =
handler ?? (FlutterErrorDetails errorDetails) async {};
FlutterError.onError = handler ?? (FlutterErrorDetails errorDetails) {};

final sut = fixture.getSut();
sut(fixture.hub, fixture.options);
Expand Down Expand Up @@ -169,7 +168,7 @@ void main() {
_mockValues();

var numberOfDefaultCalls = 0;
final defaultError = (FlutterErrorDetails errorDetails) async {
final defaultError = (FlutterErrorDetails errorDetails) {
numberOfDefaultCalls++;
};
FlutterError.onError = defaultError;
Expand Down
Loading