Make error message wording consistent across mfer/ and internal/cli/ #165

Closed
opened 2026-10-07 10:34:54 +02:00 by clawbot · 1 comment
Collaborator

Carved out of #84: its error-message audit waits on no open decision, while the rest of that issue waits on #81 and #82.

Problem

Error messages in mfer/ and internal/cli/ mix styles, and wrapping stacks them:

  • failed to ... prefixes (internal/cli/gen.go, freshen.go, fetch.go, check.go, mfer/gpg.go, mfer/serialize.go, mfer/manifest.go) next to bare operation prefixes (serialize:, deserialize:, build:, list:, export:, check:, freshen:, generate:).
  • When errors wrap, a command prefix sits over failed to load manifest over a library prefix, so one failure repeats the same words two or three times.
  • errInnerNotSet reads internal error: pbInner not set beside errInternal (internal error); errHTTPStatus is the bare word HTTP.

Definition of done

  • Every error message built in non-test code under mfer/ and internal/cli/ follows one convention: lowercase first word unless it is a name or acronym (UUID, HTTP, GPG); no trailing punctuation; no error:, failed to or similar filler; each wrap adds only what the wrapped error does not already say (the operation and the thing it acted on), so the message a user sees names the thing that failed once, without repeated words.
  • A command name prefixes a message at most once.
  • Wording only: no error changes which sentinel it wraps, whether errors.Is matches, which errors are returned, or any exit status. An error that is wrong rather than badly worded gets its own issue.
  • Tests that pin message text (mfer/errmsg_test.go, internal/cli/errmsg_test.go, any other) are updated to the new wording, still through the real call sites.
  • make check passes.

Model: opus-5-5

Carved out of https://git.eeqj.de/sneak/mfer/issues/84: its error-message audit waits on no open decision, while the rest of that issue waits on https://git.eeqj.de/sneak/mfer/issues/81 and https://git.eeqj.de/sneak/mfer/issues/82. ## Problem Error messages in `mfer/` and `internal/cli/` mix styles, and wrapping stacks them: - `failed to ...` prefixes (`internal/cli/gen.go`, `freshen.go`, `fetch.go`, `check.go`, `mfer/gpg.go`, `mfer/serialize.go`, `mfer/manifest.go`) next to bare operation prefixes (`serialize:`, `deserialize:`, `build:`, `list:`, `export:`, `check:`, `freshen:`, `generate:`). - When errors wrap, a command prefix sits over `failed to load manifest` over a library prefix, so one failure repeats the same words two or three times. - `errInnerNotSet` reads `internal error: pbInner not set` beside `errInternal` (`internal error`); `errHTTPStatus` is the bare word `HTTP`. ## Definition of done - Every error message built in non-test code under `mfer/` and `internal/cli/` follows one convention: lowercase first word unless it is a name or acronym (`UUID`, `HTTP`, `GPG`); no trailing punctuation; no `error:`, `failed to` or similar filler; each wrap adds only what the wrapped error does not already say (the operation and the thing it acted on), so the message a user sees names the thing that failed once, without repeated words. - A command name prefixes a message at most once. - Wording only: no error changes which sentinel it wraps, whether `errors.Is` matches, which errors are returned, or any exit status. An error that is wrong rather than badly worded gets its own issue. - Tests that pin message text (`mfer/errmsg_test.go`, `internal/cli/errmsg_test.go`, any other) are updated to the new wording, still through the real call sites. - `make check` passes. Model: opus-5-5
Author
Collaborator

Built in #176. Messages in mfer/ and internal/cli/ no longer carry failed to or a command-name prefix, and each wrap names only what the error it wraps does not already say, so a message stacked through several layers names what failed once. Wording only: no sentinel, errors.Is result or exit status changes. The PR body states the convention and the judgement calls taken.

Model: opus-5-5

Built in https://git.eeqj.de/sneak/mfer/pulls/176. Messages in `mfer/` and `internal/cli/` no longer carry `failed to` or a command-name prefix, and each wrap names only what the error it wraps does not already say, so a message stacked through several layers names what failed once. Wording only: no sentinel, `errors.Is` result or exit status changes. The PR body states the convention and the judgement calls taken. Model: opus-5-5
Sign in to join this conversation.