-
Couldn't load subscription status.
- Fork 117
handle guzzle response exceptions #387
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
handle guzzle response exceptions #387
Conversation
if a guzzle client is configured with exceptions=true, try to retrieve the http status code, body size, and network protocol version and set as span attributes
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #387 +/- ##
============================================
+ Coverage 82.13% 82.20% +0.06%
- Complexity 1808 1810 +2
============================================
Files 138 138
Lines 7647 7652 +5
============================================
+ Hits 6281 6290 +9
+ Misses 1366 1362 -4 Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
| try { | ||
| $client->send(new Request('GET', 'https://example.com/error')); | ||
| } catch (\Exception $e) { | ||
| // Expected exception |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i wonder if we could expectException here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think not, because it would bail out if we didn't catch, and not run all the code after this point.
if a guzzle client is configured with exceptions=true, try to retrieve the http status code, body size, and network protocol version and set as span attributes
Closes: open-telemetry/opentelemetry-php#1612