# `LangExtract.ChunkError`
[🔗](https://github.com/mdepolli/lang_extract/blob/v0.10.0/lib/lang_extract/chunk_error.ex#L1)

A failed chunk with its byte position in the source and error reason.

`reason` is deliberately open (`t:term/0`): it funnels whatever the
failing layer reported. Common shapes, non-exhaustive:

  * `t:LangExtract.Provider.error/0` — the LLM request failed, e.g.
    `{:rate_limited, ms}` or `:server_error` once 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

# `t`

```elixir
@type t() :: %LangExtract.ChunkError{
  byte_end: non_neg_integer(),
  byte_start: non_neg_integer(),
  reason: term()
}
```

# `from_chunk`

```elixir
@spec from_chunk(LangExtract.Chunker.Chunk.t(), term()) :: t()
```

Builds an error carrying `chunk`'s byte range.

---

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