# `AdyenClient.Error`
[🔗](https://github.com/iamkanishka/adyen_client/blob/v1.0.0/lib/adyen_client/error.ex#L1)

Structured error types returned by all AdyenClient API calls.

All API functions return `{:ok, response}` or `{:error, AdyenClient.Error.t()}`.

# `error_type`

```elixir
@type error_type() ::
  :api_error
  | :auth_error
  | :validation_error
  | :not_found
  | :rate_limited
  | :server_error
  | :network_error
  | :timeout
  | :config_error
  | :webhook_validation_error
```

# `t`

```elixir
@type t() :: %AdyenClient.Error{
  __exception__: true,
  error_code: String.t() | nil,
  message: String.t(),
  psp_reference: String.t() | nil,
  raw: map() | nil,
  retryable: boolean(),
  status: non_neg_integer() | nil,
  type: error_type()
}
```

# `config`

```elixir
@spec config(String.t()) :: t()
```

Build a config error.

# `from_response`

```elixir
@spec from_response(map(), non_neg_integer()) :: t()
```

Build an error from an Adyen API error response body.

# `network`

```elixir
@spec network(String.t(), boolean()) :: t()
```

Build a network/timeout error.

# `webhook_validation`

```elixir
@spec webhook_validation(String.t()) :: t()
```

Build a webhook validation error.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
