Rindle.Error exception (Rindle v0.1.5)

Copy Markdown View Source

Exception raised by bang variants on the Rindle facade when an operation fails for a non-changeset reason.

Fields:

  • :action — atom identifying the failing operation (:attach, :detach, :upload, :url, :variant_url)
  • :reason — the underlying error term returned by the non-bang variant

For changeset validation failures, bangs raise Ecto.InvalidChangesetError instead. For storage adapter exceptions, bangs re-raise the original exception directly.

Examples

iex> try do
...>   raise Rindle.Error, action: :attach, reason: :not_found
...> rescue
...>   e in Rindle.Error -> Exception.message(e)
...> end
"could not attach: not found"

Summary

Types

t()

A Rindle.Error exception struct.

Functions

Returns a human-readable message describing the failure.

Types

t()

@type t() :: %Rindle.Error{__exception__: true, action: atom(), reason: term()}

A Rindle.Error exception struct.

Functions

message(map)

@spec message(t()) :: String.t()

Returns a human-readable message describing the failure.

Branches on three common reason shapes:

  • :not_found"could not <action>: not found"
  • {:quarantine, why}"could not <action>: upload quarantined (<inspect why>)"
  • AV-facing reason atoms — exact fix-oriented guidance for the locked public vocabulary
  • any other — "could not <action>: <inspect reason>"