-
Notifications
You must be signed in to change notification settings - Fork 44
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
fix: Serialize DB errors to json in http package #1401
fix: Serialize DB errors to json in http package #1401
Conversation
137913a
to
b74662a
Compare
b74662a
to
8a62721
Compare
Codecov Report
@@ Coverage Diff @@
## develop #1401 +/- ##
===========================================
+ Coverage 70.71% 70.76% +0.04%
===========================================
Files 184 185 +1
Lines 17875 17884 +9
===========================================
+ Hits 12641 12655 +14
+ Misses 4282 4279 -3
+ Partials 952 950 -2
|
for i := range r.Errors { | ||
errors[i] = r.Errors[i].Error() | ||
} |
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.
nitpick:
for i := range r.Errors { | |
errors[i] = r.Errors[i].Error() | |
} | |
for i, e := range r.Errors { | |
errors[i] = e.Error() | |
} |
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.
Ah, I'm happy with either. Leaving as is
api/http/handlerfuncs_test.go
Outdated
) {_key} | ||
}" | ||
}` | ||
// remote line returns and tabulation from formatted statement |
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.
typo: Do you mean replace instead of remote?
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.
My bad, this comment is here to indicate that the PR author's brain auto-filtered out the comments and failed to remove it having copy-pasted from the test above.
- remove?
Test is quite lazy/bad as it doesnt really show that the returned error is just an empty object, but it is very temporary
8a62721
to
5f424ae
Compare
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
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!
* Add test for http errors Test is quite lazy/bad as it doesnt really show that the returned error is just an empty object, but it is very temporary * Serialize db errors to json correctly
Relevant issue(s)
Resolves #1383
Description
Serializes DB errors to json in http package. They were previously resolving to
"{}"
.