-
Notifications
You must be signed in to change notification settings - Fork 671
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
MF-1115 - Improve the SDK error encoding #1118
Conversation
Signed-off-by: Manuel Imperiale <[email protected]>
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
Codecov Report
@@ Coverage Diff @@
## master #1118 +/- ##
==========================================
- Coverage 76.14% 75.99% -0.16%
==========================================
Files 96 96
Lines 6888 6806 -82
==========================================
- Hits 5245 5172 -73
+ Misses 1293 1288 -5
+ Partials 350 346 -4
Continue to review full report at Codecov.
|
@@ -61,7 +61,7 @@ func (sdk mfSDK) AddBootstrap(key string, cfg BoostrapConfig) (string, error) { | |||
if err := encodeError(resp.StatusCode); err != nil { | |||
return "", 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.
What if there is an error we don't need to wrap anything? I am not sure how SDK error looks like
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.
When there is an HTTP error with a mainflux equivalent we only use the custom error. Otherwise we wrap the HTTP message with the custom mainflux error for this kind of function.
Signed-off-by: Manuel Imperiale <[email protected]>
Signed-off-by: Manuel Imperiale [email protected]