mirror of https://github.com/docker/cli.git
de6020a240
The package defined various special errors; these errors existed for two reasons; - being able to distinguish "not found" errors from other errors (as "not found" errors can be ignored in various cases). - to be able to update the context _name_ in the error message after the error was created. This was needed in cases where the name was not available at the location where the error was produced (e.g. only the "id" was present), and the helpers to detect "not found" errors did not support wrapped errors (so wrapping the error with a "name" could break logic); a `setContextName` interface and corresponding `patchErrContextName()` utility was created for this (which was a "creative", but not very standard approach). This patch: - Removes the special error-types, replacing them with errdefs definitions (which is a more common approach in our code-base to detect error types / classes). - Removes the internal utilities for error-handling, and deprecates the exported utilities (to allow external consumers to adjust their code). - Some errors have been enriched with detailed information (which may be useful for debugging / problem solving). - Note that in some cases, `patchErrContextName()` was called, but the code producing the error would never return a `setContextName` error, so would never update the error message. Signed-off-by: Sebastiaan van Stijn <github@gone.nl> |
||
---|---|---|
.. | ||
builder | ||
checkpoint | ||
commands | ||
completion | ||
config | ||
container | ||
context | ||
formatter | ||
idresolver | ||
image | ||
inspect | ||
manifest | ||
network | ||
node | ||
plugin | ||
registry | ||
secret | ||
service | ||
stack | ||
swarm | ||
system | ||
task | ||
testdata | ||
trust | ||
volume | ||
cli.go | ||
cli_options.go | ||
cli_options_test.go | ||
cli_test.go | ||
context.go | ||
context_test.go | ||
defaultcontextstore.go | ||
defaultcontextstore_test.go | ||
events_utils.go | ||
registry.go | ||
registry_test.go | ||
streams.go | ||
trust.go | ||
utils.go | ||
utils_test.go |