Skip to main content

Module error

Module error 

Source
Expand description

Typed errors.

Callers must be able to distinguish “this format is not supported” from “this file is corrupt” from “the disk is full”, because those three demand different actions from the user and different exit codes from the CLI. That is why strypt-core uses thiserror and never anyhow (ADR-0008): a boxed, stringly-typed error erases exactly the distinction the front-ends need to make.

§These messages must never contain metadata values

An error string is durable — it lands in terminal scrollback, in a shell’s history file, in a bug report pasted into a public issue tracker. A message that helpfully quoted the GPS coordinate it failed to parse would be a durable copy of the secret the user was trying to destroy (docs/THREAT_MODEL.md §5.5). Errors here name fields, offsets, and counts. They never name values.

Enums§

IoAction
What an I/O operation was attempting when it failed.
MalformedDetail
Which structural rule a malformed file broke.
ResourceLimit
Which parser ceiling a file hit.
StryptError
Everything that can go wrong in strypt-core.
UnsupportedKind
A format strypt can identify but cannot yet process.

Type Aliases§

Result
The result type used throughout strypt-core.