PactEx.Error exception (pact_ex v0.1.0)

Copy Markdown View Source

An error raised or returned by the native Pact library, or by PactEx while preparing input for it.

Fields:

  • :function - the pactffi_* function that failed, or the PactEx function that rejected the input.
  • :code - the numeric error code. -100 means an argument contained a NUL byte. -101 means PactEx rejected an interaction before calling the native library, for example a missing request or an unsupported value type.
  • :message - a description of the failure.

Summary

Functions

Builds an error from the map a native function returns.

Types

t()

@type t() :: %PactEx.Error{
  __exception__: true,
  code: integer(),
  function: String.t(),
  message: String.t()
}

Functions

from_native(map)

@spec from_native(%{function: String.t(), code: integer(), message: String.t()}) ::
  t()

Builds an error from the map a native function returns.

Raises FunctionClauseError if the map lacks :function, :code or :message.