The error type for all ExNtfy failures.
HTTP-level failures carry ntfy's JSON error fields (code, http, error,
link); transport-level failures carry the underlying exception in reason,
and a 2xx response whose body isn't a parsable message carries
{:invalid_response, details} there. Implements Exception, so it can be
raised or rendered with Exception.message/1.
Summary
Functions
Wraps a transport-level exception (e.g. Req.TransportError).
Builds an error from a non-2xx HTTP response.
Types
Functions
@spec from_exception(Exception.t()) :: t()
Wraps a transport-level exception (e.g. Req.TransportError).
@spec from_response(non_neg_integer(), map() | binary() | nil) :: t()
Builds an error from a non-2xx HTTP response.
Accepts the body as an already-decoded map (Req decodes JSON responses), a
raw JSON binary, a plain-text binary, or an empty/absent body. The http
field prefers ntfy's own "http" value, falling back to the response status.