A failed chunk with its byte position in the source and error reason.
reason is deliberately open (term/0): it funnels whatever the
failing layer reported. Common shapes, non-exhaustive:
LangExtract.Provider.error/0— the LLM request failed, e.g.{:rate_limited, ms}or:server_erroronce retries are exhausted{:invalid_format, message}or:missing_extractions— the LLM reply didn't parse{:task_exit, reason}— the chunk task crashed or timed out:drained— the runner shut down before the chunk started
Summary
Functions
Builds an error carrying a chunk-like map's byte range.
Builds an error for an explicit byte range.
Types
@type t() :: %LangExtract.ChunkError{ byte_end: non_neg_integer(), byte_start: non_neg_integer(), reason: term() }
Functions
@spec from_chunk( %{ :byte_start => non_neg_integer(), :byte_end => non_neg_integer(), optional(any()) => any() }, term() ) :: t()
Builds an error carrying a chunk-like map's byte range.
Accepts any map with integer :byte_start / :byte_end (including
%LangExtract.Chunker.Chunk{}) so Core stays free of an Advanced-tier
type dependency.
@spec from_range(non_neg_integer(), non_neg_integer(), term()) :: t()
Builds an error for an explicit byte range.
Prefer this over from_chunk/2 when you already have the range — Core
does not type-depend on Advanced Chunker.Chunk.