-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[receiver/otlp] Refactor error handling into helper #9307
[receiver/otlp] Refactor error handling into helper #9307
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #9307 +/- ##
==========================================
- Coverage 90.35% 90.24% -0.12%
==========================================
Files 340 344 +4
Lines 17968 17996 +28
==========================================
+ Hits 16235 16240 +5
- Misses 1410 1428 +18
- Partials 323 328 +5 ☔ View full report in Codecov by Sentry. |
5a83d85
to
6463b53
Compare
s := errors.GetStatusFromError(err) | ||
return plogotlp.NewExportResponse(), s.Err() |
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.
s := errors.GetStatusFromError(err) | |
return plogotlp.NewExportResponse(), s.Err() | |
return plogotlp.NewExportResponse(), errors.GetStatusFromError(err).Err() |
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.
If this is the case, why not always return the error from GetStatusFromError?
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.
Returning the entire Status
makes GetStatusFromError
more flexible for future use, but since there is not ab actual use case yet, and this is an internal package, I am ok with GetStatusFromError
returning an error
that made from a Status
.
I don't feel strongly about this either way, so let me know what you all prefer.
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.
Since this is an internal API I prefer to simplify usage, since everywhere we call .Err()
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.
Updated
s := errors.GetStatusFromError(err) | ||
return plogotlp.NewExportResponse(), s.Err() |
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.
If this is the case, why not always return the error from GetStatusFromError?
…rrors (#9357) **Description:** Updates the receiver's http response to return a proper http status based on whether or not the pipeline returned a retryable error. Builds upon the work done in #8080 and #9307 **Link to tracking Issue:** Closes #9337 Closes #8132 Closes #9636 Closes #6725 **Testing:** Updated lots of unit tests
Description:
Moves reused code into helper function
Link to tracking Issue:
Closes #9300
Testing:
Added unit tests