You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cli/command: rewrite user-facing error messages flagged by the audit
Applies the rewrites produced by an end-to-end review of CLI error
quality (audit/{inventory,review,rewrites,editorial}.json). 31 messages
across 11 command areas, organised around the patterns that surfaced
most often:
Factual / wrong-noun fixes — messages that misdirected users to the
wrong layer or named things that didn't exist:
- image/list: --show-digest -> --digests (the actual flag name)
- image/load: stdin-state assertion now matches IsTerminal() guard
- inspect: template execution failures no longer mislabelled as
parsing errors
- system/info: blames the actual cause (info collection) not
pretty-printing
- image/save, container/export: -o open failures name the file,
not the operation
- image/build: build-context errors enumerate supported forms
instead of misnaming everything as a missing path
- manifest/annotate: prints the os/arch pair actually validated
- context/options: describes the missing-endpoint state rather
than implying a fetch failure
- container/cp: corrects the misleading 'container source' wording
Partial success surfaced — operations that succeeded with a
follow-up failure now say so, preventing wasted retries:
- container/create: cidfile write failure (container exists)
- image/build: aux-message decode failure (build succeeded)
- image/build: missing image ID for --iidfile (build succeeded)
Refusal reason explained — TTY-refusal messages for binary tar
output now state why instead of using 'cowardly':
- container/export, context/export, image/save
Echo-the-value / name-the-flag — validation errors now include
what the user typed and the expected form:
- container/opts: --pid, --uts, --userns, --cgroupns,
--storage-opt, --device (×2 branches), --log-driver
- network/connect: --driver-opt
- network/create: --subnet (names both overlapping subnets)
- volume/update, container/update, context/create
Internal jargon replaced — code-level field names removed from
user-facing wording:
- container/exec: 'exec ID empty' replaced with daemon-anomaly
framing
Cause preserved — manifest/push: ErrBlobCreated is now wrapped via
%w and the wording describes what actually happened.
Errors that have an actionable hint use internal/hint.Wrap so the
hint is rendered separately from the message at the top-level error
handler. Errors that benefit from a sibling-site fix (image/build's
context detection in image/build/context_detect.go) carry that fix
to keep the same condition producing the same wording regardless of
entry point.
Tests updated to match the new wordings; substring-based assertions
stay stable because hints are no longer part of err.Error().
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
0 commit comments