Module errors
Expand description
The errors generator: docs/reference/errors.md from the Error enum.
The source of truth is crates/atune_core/src/error.rs — the enum itself,
its thiserror messages and its doc comments (D29,
docs/design/11-documentation-plan.md §7). It is atune_core::Error, and
atune::Error is a re-export of it, so the published surface has exactly one
error type and this page documents it. atune_cli’s CliError is deliberately
absent: it is pub(crate), not API, and the user-visible half of it is the exit
code, which belongs to the CLI reference.
Why a source parse and not reflection. A #[error("…")] message is a
compile-time template. At runtime only its rendered form exists, and only for
a variant somebody constructed — Display can show the message for one
concrete unknown parameter, but nothing can recover the template with its
placeholder still in it, which is what a catalog must print. syn reads the
registry the code already keeps, the same way atune_derive reads a struct.
Fail-closed, per §17.6: a variant whose message is not a literal template, or
that is gated by a #[cfg] this generator has no rule for, stops the run.
Structs§
- Error
Catalog - Generates the error catalog page.
Enums§
- Message 🔒
- A variant’s
thiserrormessage.
Constants§
- ENUM 🔒
- The enum documented by the page.
- GENERATOR 🔒
- This generator’s name, for fail-closed error messages.
- SOURCE 🔒
- The file that owns the error registry.
Functions§
- documentation 🔒
- The doc comment on an item, as Markdown paragraphs.
- message 🔒
- Reads the
#[error(…)]attribute of one variant. - reject_
conditional 🔒 - Refuses a variant whose presence depends on a
cfg. - render_
enum 🔒 - Writes the whole catalog.
- render_
payload 🔒 - Writes the variant’s fields, when they carry information a reader needs.
- render_
source 🔒 - Notes that the variant keeps the error that caused it.
- render_
variant 🔒 - Writes one variant: its message template, its documentation, its payload.