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

pkg/nydussdk: add more context on returning errors #27

Merged
merged 1 commit into from
Feb 23, 2022

Conversation

eryugey
Copy link
Collaborator

@eryugey eryugey commented Feb 23, 2022

So that we know where does that error come from, and make debug easier.

Fixes: #26
Signed-off-by: Eryu Guan [email protected]

So that we know where does that error come from, and make debug easier.

Fixes: containerd#26
Signed-off-by: Eryu Guan <[email protected]>
@codecov-commenter
Copy link

Codecov Report

Merging #27 (bfd35b9) into main (cc06993) will increase coverage by 0.05%.
The diff coverage is 13.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #27      +/-   ##
==========================================
+ Coverage   34.41%   34.46%   +0.05%     
==========================================
  Files          18       18              
  Lines        1293     1294       +1     
==========================================
+ Hits          445      446       +1     
  Misses        777      777              
  Partials       71       71              
Impacted Files Coverage Δ
pkg/nydussdk/client.go 29.54% <13.33%> (+0.80%) ⬆️

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 cc06993...bfd35b9. Read the comment docs.

Copy link
Collaborator

@imeoer imeoer left a comment

Choose a reason for hiding this comment

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

LGTM, should also add an error wrap to the waitUntilSocketReady call?

@eryugey
Copy link
Collaborator Author

eryugey commented Feb 23, 2022

LGTM, should also add an error wrap to the waitUntilSocketReady call?

Thought about that too, but at last I decide to add context only to public functions, as the errors returned by internal functions like waitUntilSocketReady() will be captured by public functions as well. The only exception is handleMountError(), it's an internal function, but used to handle errors, so I added context to it as well.

@eryugey eryugey merged commit e6dcb10 into containerd:main Feb 23, 2022
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.

nydus sdk lack of error context
3 participants