Skip to content

Add SentryRequest context for HttpException and SocketException #1118

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 19 commits into from
Nov 17, 2022

Conversation

ueman
Copy link
Collaborator

@ueman ueman commented Nov 9, 2022

📜 Description

Add SentryRequest context for HttpException and SocketException.
Also SocketException and FileSystemException have an underlying OSError, which is now reported as underlying exception.

I've also done some small refactoring of moving the enricher event processors into the event processor folder. I've also added a new constructor to SentryRequest and removed duplicated code.

💡 Motivation and Context

HttpExceptions and SocketException can now be filtered via the request context.

💚 How did you test it?

Added new tests.

📝 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

@codecov-commenter
Copy link

codecov-commenter commented Nov 9, 2022

Codecov Report

Base: 90.09% // Head: 89.95% // Decreases project coverage by -0.13% ⚠️

Coverage data is based on head (62eb116) compared to base (a49594a).
Patch coverage: 91.54% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1118      +/-   ##
==========================================
- Coverage   90.09%   89.95%   -0.14%     
==========================================
  Files         117      110       -7     
  Lines        3605     3456     -149     
==========================================
- Hits         3248     3109     -139     
+ Misses        357      347      -10     
Impacted Files Coverage Δ
dart/lib/src/protocol/sentry_gpu.dart 93.15% <ø> (ø)
...cessor/exception/io_exception_event_processor.dart 86.36% <86.36%> (ø)
...t_processor/enricher/enricher_event_processor.dart 100.00% <100.00%> (ø)
...rocessor/enricher/io_enricher_event_processor.dart 94.11% <100.00%> (ø)
...processor/exception/exception_event_processor.dart 100.00% <100.00%> (ø)
...art/lib/src/http_client/failed_request_client.dart 93.33% <100.00%> (-0.79%) ⬇️
dart/lib/src/protocol/sentry_request.dart 98.24% <100.00%> (+0.28%) ⬆️
dart/lib/src/scope.dart 96.72% <100.00%> (-0.11%) ⬇️
dart/lib/src/sentry.dart 85.71% <100.00%> (+0.18%) ⬆️
dio/lib/src/dio_event_processor.dart
... and 8 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@marandaneto marandaneto left a comment

Choose a reason for hiding this comment

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

Thanks @ueman

@ueman
Copy link
Collaborator Author

ueman commented Nov 17, 2022

The failures come again because of the newly introduced SentryRequest.fromUri constructor which the dio and flutter libraries don't know when pana runs :(

@marandaneto
Copy link
Contributor

The failures come again because of the newly introduced SentryRequest.fromUri constructor which the dio and flutter libraries don't know when pana runs :(

yeah, it's pana, after publishing it, it will be green.

@marandaneto marandaneto merged commit f4cc744 into getsentry:main Nov 17, 2022
@ueman ueman deleted the improve-exceptions branch November 17, 2022 20:26
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.

4 participants