Correios CEP v0.6.0 Correios.CEP.Error exception View Source

Error structure.

Link to this section Summary

Functions

Returns the reason message of the exception.

Creates a new Correios.CEP.Error exception.

Link to this section Types

Specs

t() :: %Correios.CEP.Error{__exception__: term(), reason: String.t()}

Link to this section Functions

Returns the reason message of the exception.

Examples

iex> error = %Correios.CEP.Error{reason: "Catastrophic error!"}
...> Correios.CEP.Error.message(error)
"Catastrophic error!"

Specs

new(any()) :: t()

Creates a new Correios.CEP.Error exception.

Examples

iex> Correios.CEP.Error.new("Catastrophic error!")
%Correios.CEP.Error{reason: "Catastrophic error!"}

iex> Correios.CEP.Error.new('Catastrophic error!')
%Correios.CEP.Error{reason: "Catastrophic error!"}

iex> Correios.CEP.Error.new(:some_error)
%Correios.CEP.Error{reason: "some_error"}

iex> Correios.CEP.Error.new(%{a: 123})
%Correios.CEP.Error{reason: "%{a: 123}"}