Loopback.HTTPError (Loopback v0.1.0)

Copy Markdown View Source

An HTTP transport error, like a timeout, returned by the fakes instead of a response.

Fields

  • :reason - the reason of the error, like :timeout, :closed or :econnrefused.

Summary

Types

t()

An HTTP transport error, returned by the fakes instead of a response.

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

t()

@type t() :: %Loopback.HTTPError{reason: term()}

An HTTP transport error, returned by the fakes instead of a response.

Functions

closed()

@spec closed() :: t()

Builds an error for a closed connection, with the reason :closed.

connection_refused()

@spec connection_refused() :: t()

Builds an error for a refused connection, with the reason :econnrefused.

new(params)

@spec new(map() | keyword()) :: t()

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)

timeout()

@spec timeout() :: t()

Builds an error for a timeout, with the reason :timeout.