Skip to content

errors: use errdefs errors in client and commands#3418

Merged
fuweid merged 1 commit intocontainerd:masterfrom
stevvooe:backout-error-changes
Jul 18, 2019
Merged

errors: use errdefs errors in client and commands#3418
fuweid merged 1 commit intocontainerd:masterfrom
stevvooe:backout-error-changes

Conversation

@stevvooe
Copy link
Copy Markdown
Member

@stevvooe stevvooe commented Jul 16, 2019

This change moves from specific, global errors to the errdefs errors. This makes it easy to handle certain classes of errors while still adding context to the failure.

Comment thread client.go Outdated
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This could be ErrUnavailable.

Comment thread client.go Outdated
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This could be ErrUnavailable.

Comment thread client.go Outdated
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This could be ErrUnavailable.

Comment thread client.go Outdated
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This could be ErrUnsupported.

Comment thread client.go Outdated
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This could be ErrUnavailable.

Comment thread cmd/containerd/command/main.go Outdated
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This could be ErrInvalidArgument.

Comment thread cmd/containerd/command/publish.go Outdated
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This could be ErrInvalidArgument.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This could be ErrInvalidArgument.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This could be ErrInvalidArgument.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This could be ErrInvalidArgument.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This could be ErrInvalidArgument.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This could be ErrInvalidArgument.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This could be ErrInvalidArgument.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This could be ErrInvalidArgument.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This could be ErrInvalidArgument.

@stevvooe
Copy link
Copy Markdown
Member Author

I also annotated each error with the correct wrapped error type.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Jul 16, 2019

Build succeeded.

@fuweid
Copy link
Copy Markdown
Member

fuweid commented Jul 16, 2019

change is LGTM. but the CI is not happy with non-signing commit :)

@stevvooe
Copy link
Copy Markdown
Member Author

@fuweid I’ll apply the suggestions and then squash the commit

@stevvooe stevvooe force-pushed the backout-error-changes branch from e9a208b to 6520c37 Compare July 17, 2019 16:16
@stevvooe stevvooe changed the title backout error changes errors: use errdefs errors in client and commands Jul 17, 2019
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Jul 17, 2019

Build succeeded.

Comment thread client.go Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ErrNotImplemented

@stevvooe stevvooe force-pushed the backout-error-changes branch from 6520c37 to 27c9f43 Compare July 17, 2019 20:33
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

wrong errors package

This change moves from specific, global errors to the errdefs errors.
This makes it easy to handle certain classes of errors while still
adding context to the failure.

Signed-off-by: Stephen Day <[email protected]>
@stevvooe stevvooe force-pushed the backout-error-changes branch from 27c9f43 to 804ae89 Compare July 17, 2019 20:42
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Jul 17, 2019

Build succeeded.

@codecov-io
Copy link
Copy Markdown

codecov-io commented Jul 17, 2019

Codecov Report

Merging #3418 into master will decrease coverage by 4%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3418      +/-   ##
==========================================
- Coverage   44.28%   40.27%   -4.01%     
==========================================
  Files         123       76      -47     
  Lines       13665    10496    -3169     
==========================================
- Hits         6051     4227    -1824     
+ Misses       6683     5685     -998     
+ Partials      931      584     -347
Flag Coverage Δ
#linux ?
#windows 40.27% <ø> (+0.45%) ⬆️
Impacted Files Coverage Δ
cio/io.go 1.4% <0%> (-45.08%) ⬇️
snapshots/native/native.go 1.79% <0%> (-41.26%) ⬇️
archive/tar.go 16.99% <0%> (-26.8%) ⬇️
metadata/snapshot.go 24.02% <0%> (-23.5%) ⬇️
content/local/writer.go 57.69% <0%> (-0.97%) ⬇️
gc/scheduler/scheduler.go 66.34% <0%> (-0.97%) ⬇️
oci/spec_opts.go 30.33% <0%> (-0.25%) ⬇️
remotes/docker/authorizer.go 70.52% <0%> (-0.01%) ⬇️
remotes/docker/pusher.go 0% <0%> (ø) ⬆️
mount/temp_unix.go
... and 49 more

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 c90a3d4...804ae89. Read the comment docs.

Copy link
Copy Markdown
Member

@dmcgowan dmcgowan left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Member

@fuweid fuweid left a comment

Choose a reason for hiding this comment

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

LGTM

@fuweid fuweid merged commit 283d5d9 into containerd:master Jul 18, 2019
@stevvooe stevvooe deleted the backout-error-changes branch July 18, 2019 21:28
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.

4 participants