PhoenixGenApi.Errors.DecodeError exception (PhoenixGenApi v2.20.1)

Copy Markdown View Source

Error raised when request payload decoding fails.

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

Summary

Functions

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

Types

t()

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

Functions

exception(code, message, details \\ nil)

@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.