Medplum.Error exception (medplum_elixir v0.2.0)

Copy Markdown View Source

Stable error shape returned by Medplum requests.

Summary

Types

t()

Structured error returned by Medplum operations.

Error categories returned by configuration, auth, transport, and API failures.

Functions

Builds a new error struct with a generated message.

Types

t()

@type t() :: %Medplum.Error{
  __exception__: term(),
  body: term() | nil,
  message: String.t(),
  reason: term() | nil,
  status: non_neg_integer() | nil,
  type: type()
}

Structured error returned by Medplum operations.

type()

@type type() ::
  :config_error
  | :auth_failed
  | :request_failed
  | :api_error
  | :invalid_response

Error categories returned by configuration, auth, transport, and API failures.

Functions

new(type, attrs \\ [])

@spec new(
  type(),
  keyword()
) :: t()

Builds a new error struct with a generated message.