1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
Commit graph

6 commits

Author SHA1 Message Date
Kostadin Plachkov
aeddf93de0 Implement Unwrap to errors
Signed-off-by: Kostadin Plachkov <k.n.plachkov@gmail.com>
2020-11-21 16:36:35 +01:00
Sebastiaan van Stijn
7d4b788381 errdefs: remove "ErrAlreadyExists" because it's not an error
The `ErrAlreadyExists` error is used for 304 statuses, which
is not an error-condition, so should probably not be defined
as part of the errdefs package.

This patch removes the `ErrAlreadyExists` interface, and related
helpers, as it was currently not used.

Note that a 304 status can fulfil certain use-cases, but (refering
to https://www.codetinkerer.com/2015/12/04/choosing-an-http-status-code.html)
could probably be handled by a 200 OK, unless we want to perform
caching in the client.

If we do want to use 304 statuses, perhaps we need a separate class
of "errors" for this (?).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-03-21 21:25:15 +00:00
Sebastiaan van Stijn
264775b52b
Make errdefs helpers idempotent
Don't convert errors if they already have the right type

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-03 11:16:01 +01:00
Sebastiaan van Stijn
43a8ec654b
Add missing nil-check on errdefs.Unavailable()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-12-30 15:18:57 +01:00
Daniel Nephin
4f0d95fa6e Add canonical import comment
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-02-05 16:51:57 -05:00
Brian Goff
d453fe35b9 Move api/errdefs to errdefs
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2018-01-11 21:21:43 -05:00
Renamed from api/errdefs/helpers.go (Browse further)