Flux Redis v0.0.2 FluxRedis.Error exception View Source
FluxRedis error module/struct.
Link to this section Summary
Functions
Generate message String.t/0 based on :reason and :metadata.
Generate raw message String.t/0 based on :reason to be used by external
modules or services, such as Gettext.
Link to this section Types
FluxRedis.Error.t/0 message options.
Every FluxRedis error is a FluxRedis.Error.t/0.
Redix errors are merged with FluxRedis.Error.t/0 and can be accessed
with :detail key inside :metadatamap/0.
Link to this section Functions
message(error)
View Source (since 0.0.1)message(FluxRedis.Error.t()) :: String.t()
Generate message String.t/0 based on :reason and :metadata.
Parameters
error- TheFluxRedis.Error.t/0.
Examples
iex> error = %FluxRedis.Error{reason: :key_not_found, metadata: %{key: :id}}
...> FluxRedis.Error.message(error)
"data does not have key 'id'"
message_raw(error, opts \\ [])
View Source (since 0.0.1)message_raw(FluxRedis.Error.t(), opts()) :: String.t()
Generate raw message String.t/0 based on :reason to be used by external
modules or services, such as Gettext.
Parameters
error- TheFluxRedis.Error.t/0.opts- Theopts/0keyword/0. Defaults to[]. Options are::format- Format message keys to a language standard. Options are::elixir- Message keys are defined as "%{key}", satisfying theGettextpattern.:python- Message keys are defined as "%(key)s", satisfying the python gettext pattern.
Examples
iex> error = %FluxRedis.Error{reason: :key_not_found, metadata: %{key: :id}}
...> FluxRedis.Error.message_raw(error, format: :python)
"data does not have key '%(key)s'"