Skip to content
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

Merged
merged 1 commit into from
Apr 15, 2020
Merged

MF-1115 - Improve the SDK error encoding #1118

merged 1 commit into from
Apr 15, 2020

Conversation

manuio
Copy link
Contributor

@manuio manuio commented Apr 15, 2020

Signed-off-by: Manuel Imperiale [email protected]

@manuio manuio requested a review from a team as a code owner April 15, 2020 16:32
Copy link
Contributor

@drasko drasko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@codecov-io
Copy link

Codecov Report

Merging #1118 into master will decrease coverage by 0.15%.
The diff coverage is 3.84%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
sdk/go/bootstrap.go 0.00% <0.00%> (ø)
sdk/go/channels.go 57.77% <0.00%> (ø)
sdk/go/sdk.go 97.82% <ø> (ø)
sdk/go/things.go 58.43% <0.00%> (ø)
sdk/go/users.go 23.33% <0.00%> (ø)
sdk/go/version.go 41.17% <0.00%> (-5.50%) ⬇️
sdk/go/message.go 36.73% <50.00%> (ø)
bootstrap/service.go 78.85% <0.00%> (-2.18%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4c970a8...552f76f. Read the comment docs.

@@ -61,7 +61,7 @@ func (sdk mfSDK) AddBootstrap(key string, cfg BoostrapConfig) (string, error) {
if err := encodeError(resp.StatusCode); err != nil {
return "", err
Copy link
Collaborator

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

Copy link
Contributor Author

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.

@drasko drasko merged commit 6bd7457 into absmach:master Apr 15, 2020
@manuio manuio deleted the sdk branch April 16, 2020 06:21
manuio added a commit that referenced this pull request Oct 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants