WorkOS.ApiError exception (WorkOS SDK for Elixir v3.0.1)

Copy Markdown View Source

A non-2xx response from the API.

The :kind field classifies the failure by status code (e.g. :not_found), so callers can pattern-match without memorizing status numbers. :param carries the offending field name when the API names one.

Summary

Types

kind()

@type kind() ::
  :bad_request
  | :authentication
  | :authorization
  | :not_found
  | :conflict
  | :unprocessable_entity
  | :rate_limit_exceeded
  | :server
  | :api

t()

@type t() :: %WorkOS.ApiError{
  __exception__: true,
  body: map() | String.t() | nil,
  code: String.t() | nil,
  kind: kind(),
  message: String.t(),
  param: String.t() | nil,
  request_id: String.t() | nil,
  status: pos_integer()
}