Flux AMQP v0.0.5 FluxAMQP.Error exception View Source

FluxAMQP error module.

Link to this section Summary

Types

t()

FluxAMQP error struct

Functions

Generate message String.t/0 based on :reason.

Generate {:error, atom} based on :reason.

Link to this section Types

Link to this type

t()

View Source (since 0.0.5)
t() :: %FluxAMQP.Error{__exception__: term(), metadata: map(), reason: atom()}

FluxAMQP error struct

Link to this section Functions

Link to this function

message(error)

View Source (since 0.0.5)
message(FluxAMQP.Error.t()) :: String.t()

Generate message String.t/0 based on :reason.

Parameters

Examples

iex> error = %FluxAMQP.Error{reason: :failed_to_connect}
...> FluxAMQP.Error.message(error)
"failed to connect to AMQP broker"
Link to this function

to_tuple(error)

View Source (since 0.0.5)
to_tuple(FluxAMQP.Error.t()) :: {:error, atom()}

Generate {:error, atom} based on :reason.

Parameters

  • error - The t:FluxRedis.Error.t/0.

Examples

iex> error = %FluxAMQP.Error{reason: :failed_to_connect}
...> FluxAMQP.Error.to_tuple(error)
{:error, :failed_to_connect}