-
Notifications
You must be signed in to change notification settings - Fork 14
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
feat: expose http response headers in ServerError #100
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #100 +/- ##
==========================================
+ Coverage 85.25% 85.28% +0.02%
==========================================
Files 14 14
Lines 1119 1121 +2
==========================================
+ Hits 954 956 +2
Misses 137 137
Partials 28 28 ☔ View full report in Codecov by Sentry. |
influxdb3/write_test.go
Outdated
assert.NotPanics(t, func() { | ||
errors.As(err, &serr) | ||
}) |
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 it is safe to assume a correct pointer to As
is passed since it's declared just before it, I would just make sure it's the correct target type, ie.
assert.NotPanics(t, func() { | |
errors.As(err, &serr) | |
}) | |
require.True(t, errors.As(err, &serr)) |
And check return value of errors.As
in examples too.
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.
Changed, however linter wants to enforce this solution:
require.ErrorAs(t, err, &serr)
So, used the linter suggestion.
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.
LGTM now.
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.
LGTM 🚀
Proposed Changes
http.Header
toServerError
Checklist