-
Notifications
You must be signed in to change notification settings - Fork 18.8k
client: Use containerd errdefs to convert http errors #50030
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
Conversation
@vvoland this one can be rebased |
@@ -5,6 +5,8 @@ import ( | |||
) | |||
|
|||
// FromStatusCode creates an errdef error, based on the provided HTTP status-code | |||
// | |||
// Deprecated: Use [cerrdefs.ToNative] instead | |||
func FromStatusCode(err error, statusCode int) 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.
Can we make this wrap httpErrorFromStatusCode
? That way the test would also cover that the behavior is un-modified.
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.
That would require moving it out of client
to a shared package though. Possibly under internal
, but that would make the errdefs
depending on the internal
.. (although that might not be such a big deal if it's going away?)
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.
oh! my mistake; I glanced over after I commented, and thought they were in the same package 😞
Previously, we were using our own `FromStatusCode` function to map HTTP status codes to Docker error types. Switch to the containerd code. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
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
Previously, we were using our own
FromStatusCode
function to map HTTP status codes to Docker error types. Switch to the containerd code.- A picture of a cute animal (not mandatory but encouraged)