An HTTP transport error, like a timeout, returned by the fakes instead of a response.
Fields
:reason- the reason of the error, like:timeout,:closedor:econnrefused.
Summary
Functions
Builds an error for a closed connection, with the reason :closed.
Builds an error for a refused connection, with the reason :econnrefused.
Builds an error from a map or a keyword list of its fields.
Builds an error for a timeout, with the reason :timeout.
Types
@type t() :: %Loopback.HTTPError{reason: term()}
An HTTP transport error, returned by the fakes instead of a response.
Functions
@spec closed() :: t()
Builds an error for a closed connection, with the reason :closed.
@spec connection_refused() :: t()
Builds an error for a refused connection, with the reason :econnrefused.
Builds an error from a map or a keyword list of its fields.
Raises ArgumentError when :reason is missing.
Examples
Loopback.HTTPError.new(reason: :nxdomain)
@spec timeout() :: t()
Builds an error for a timeout, with the reason :timeout.