Skip to main content

Module errors

Module errors 

Source
Expand description

Typed errors and their human-readable rendering (spec 0025).

  • CardError: a failure reported by the card (status word) or by PC/SC, tagged with the operation yb was performing.
  • YbError: one of yb’s own errors, already phrased as what / why / fix.

Both travel through anyhow unchanged; render turns an error chain into the text shown to the user.

Structs§

ErrCtx
What the failing step knew when it failed (spec 0025 §1).
Explanation
The user-facing explanation of an error.
RenderEnv
What the renderer needs besides the error itself. Only the fallback for unexpected errors uses it (spec 0025 §2).
YbError
One of yb’s own errors (not from the card), phrased for the user.

Enums§

CardError
A failure reported by the card or by PC/SC.
CardOp
The card operation that failed, in yb terms.
PcscCode
A PC/SC failure, reduced to the cases the catalog explains.
PcscOp
The PC/SC step that failed.

Functions§

explain_pcsc
Explanation of a PC/SC failure, e.g. for list-readers hints.
render
Render an error chain for the user (spec 0025 §3).