Current section
Files
Jump to
Current section
Files
lib/llm/stream/error.ex
defmodule LLM.Stream.Error do
@moduledoc """
Error chunk from a streaming response.
Emitted when the provider returns an error during streaming. The stream
typically ends after an error chunk is received.
## Fields
- `:message` — human-readable error description
- `:code` — optional error code from the provider (e.g., `"rate_limit_exceeded"`)
## Example
%LLM.Stream.Error{message: "Rate limit exceeded", code: "rate_limit_exceeded"}
"""
@type t :: %__MODULE__{
message: String.t(),
code: String.t() | nil
}
defstruct [:message, code: nil]
end