Skip to content

Fix: Do not throw when Throwable type is not supported for associating errors to a transaction #692

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

Merged
merged 4 commits into from
Jan 11, 2022

Conversation

marandaneto
Copy link
Contributor

@marandaneto marandaneto commented Jan 10, 2022

📜 Description

Fix: Do not throw when Throwable type is not supported for associating errors to a transaction

💡 Motivation and Context

Fixes #680

💚 How did you test it?

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • I updated the docs if needed
  • All tests passing
  • No breaking changes

🔮 Next steps

} catch (exception, stackTrace) {
_options.logger(
SentryLevel.info,
'Throwable type: ${throwable.runtimeType} is not supported for associating errors to a transaction.',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this should point to the docs, which says which types are not supported? Or maybe include the list of unspported types?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

throwable.runtimeType does the job for now, but indeed a better logging message here would be awesome, I will merge and release for now because it's a bug and later improve it.

@@ -31,7 +31,7 @@ class Hub {

late SentryTracesSampler _tracesSampler;

final _WeakMap _throwableToSpan = _WeakMap();
late final _WeakMap _throwableToSpan;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also FYI: Starting with Dart 2.17 there's a WeakReference.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will take some time, thanks for pointing out o/

Copy link
Contributor

@brustolin brustolin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@marandaneto marandaneto merged commit adc9fc5 into main Jan 11, 2022
@marandaneto marandaneto deleted the fix/expando-not-supported branch January 11, 2022 11:26
@github-actions
Copy link
Contributor

Fails
🚫 Please consider adding a changelog entry for the next release.
`Instructions and example for changelog`$

Please add an entry to CHANGELOG.md` to the "Unreleased" section under the following heading:

To the changelog entry, please add a link to this PR (consider a more descriptive message):`

- Do not throw when Throwable type is not supported for associating errors to a transaction(#692)

If none of the above apply, you can opt out by adding _#skip-changelog_ to the PR description.

Generated by 🚫 dangerJS against 328f5b3

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

Successfully merging this pull request may close these issues.

Error in console when calling Sentry.captureException
3 participants