Skip to main content

Module error

Module error 

Source
Expand description

Error taxonomy used across the crate.

Errors surfaced to clients are modelled as MostroError, which is split into two branches:

  • MostroError::MostroCantDo — a “soft” error: the request was well-formed but the server refuses to perform the action (e.g. the order is not in the right state). Clients should surface the inner CantDoReason to the user.
  • MostroError::MostroInternalErr — a “hard” error: something went wrong while processing the request (database failure, Nostr relay issue, malformed invoice, etc.). The inner ServiceError carries the diagnostic detail.

Both inner enums implement Display with human-readable messages suited for logging.

Enums§

CantDoReason
Machine-readable reasons carried by a CantDo response.
MostroError
Top-level error type returned by the Mostro API surface.
ServiceError
Internal errors raised by services behind the Mostro API.