DrinkMeAlice.Error (drink_me_alice v0.1.0)

Copy Markdown

A typed error: a stable code string and a bounded detail term.

Codes are stable strings (malformed_message, bounded_limit_exceeded, invalid_input, internal_error, database_unavailable, …) so a host can map this struct onto its own error type with a field copy.

Summary

Types

t()

@type t() :: %DrinkMeAlice.Error{code: binary(), detail: term()}

Functions

bounded_exceeded(detail)

@spec bounded_exceeded(term()) :: t()

invalid(detail)

@spec invalid(term()) :: t()

malformed(detail)

@spec malformed(term()) :: t()

new(code, detail \\ nil)

@spec new(binary(), term()) :: t()