Skip to content

captureException may fail on Web and release mode, on Chrome, if you do stackTrace.toString works but not on Safari #431

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ueman opened this issue Apr 26, 2021 · 8 comments

Comments

@ueman
Copy link
Collaborator

ueman commented Apr 26, 2021

#187 (comment)

Edit: This was previously tracked as a card on the kanban board and just converted to an issue.

@ueman
Copy link
Collaborator Author

ueman commented Apr 26, 2021

Chrome and Safari both record exceptions with Sentry.captureException: https://sentry.io/organizations/sentry-sdks/issues/2363318841/events/?project=5428562
One event is from chrome and the other one is from safari.

@ueman
Copy link
Collaborator Author

ueman commented Apr 26, 2021

@ueman
Copy link
Collaborator Author

ueman commented Apr 26, 2021

Firefox also works

@marandaneto
Copy link
Contributor

@ueman just to be sure, run https://github.com/getsentry/sentry-dart/tree/main/dart/example_web which isn't the same example as tested before, on release mode.

@marandaneto
Copy link
Contributor

marandaneto commented Apr 26, 2021

another thing to test is, if its actually using the given stackTrace or if it's actually getting StackTrace.current, what I mean is, we just need to be sure it works correctly, when this was tested, we were not using StackTrace.current if stackTrace was null or something

@ueman
Copy link
Collaborator Author

ueman commented Apr 26, 2021

I tested the following scenarios:

1

Flutter example at https://getsentry.github.io/sentry-dart/ on Chrome, Safari and Firefox (all on macOS)

2

from Dart's web example, on Chrome, Safari, Firefox (all on macOS)

try {
    await buildCard();
  } catch (error, stackTrace) {
    final sentryId = await Sentry.captureException(
      error,
      stackTrace: stackTrace,
    );
  }

3

Modified 2 to the following
from Dart's web example, on Chrome, Safari, Firefox (all on macOS)

try {
    await buildCard();
  } catch (error, stackTrace) {
    final sentryId = await Sentry.captureException(
      error,
      stackTrace: null,
    );
  }

3

Modified 2 to the following
from Dart's web example, on Chrome, Safari, Firefox (all on macOS)

try {
    await buildCard();
  } catch (error, stackTrace) {
    final sentryId = await Sentry.captureException(
      error,
      stackTrace: StackTrace.current,
    );
  }

4

Modified 2 to the following
from Dart's web example, on Chrome, Safari, Firefox (all on macOS)

try {
    await buildCard();
  } catch (error, stackTrace) {
    final sentryId = await Sentry.captureException(
      error,
      stackTrace: stackTrace.toString(),
    );
  }

All scenarios work as expected.

Test setup:

  • Firefox v86.0.1
  • Safari Version 14.0.3 (16610.4.3.1.7)
  • Chrome Version 90.0.4430.85
  • macOS Version 11.2.3

@ueman
Copy link
Collaborator Author

ueman commented Apr 26, 2021

@marandaneto
Copy link
Contributor

Let's just close it then @ueman , users will come to it if they see something like that, could be either an oversight during the test at that time or even an older dart/flutter issue on 1.x which isn't there anymore, thanks for testing

@ueman ueman mentioned this issue Apr 26, 2021
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants