# `PhoenixGenApi.Errors.DecodeError`
[🔗](https://github.com/ohhi-vn/phoenix_gen_api/blob/main/lib/phoenix_gen_api/errors/decode_error.ex#L1)

Error raised when request payload decoding fails.

This exception carries a structured error code so callers can
differentiate between client errors and internal errors.

# `t`

```elixir
@type t() :: %PhoenixGenApi.Errors.DecodeError{
  __exception__: term(),
  code: :invalid_payload | :missing_field | :internal_error,
  details: term(),
  message: String.t()
}
```

# `exception`

```elixir
@spec exception(code :: atom(), message :: String.t(), details :: term()) ::
  %PhoenixGenApi.Errors.DecodeError{
    __exception__: term(),
    code: term(),
    details: term(),
    message: term()
  }
```

Creates a DecodeError with the given code, message, and optional details.

---

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