# `LeXtract.Error.External.TokenizerLoad`
[🔗](https://github.com/YgorCastor/lextract.git/blob/main/lib/lextract/error/external/tokenizer_load.ex#L1)

Error for tokenizer loading failures.

Raised when a tokenizer cannot be loaded from Hugging Face or
when tokenizer initialization fails.

## Examples

    iex> error = LeXtract.Error.External.TokenizerLoad.exception(
    ...>   reason: "network timeout"
    ...> )
    iex> Exception.message(error)
    "Failed to load tokenizer: network timeout"

    iex> error = LeXtract.Error.External.TokenizerLoad.exception(
    ...>   reason: "model not found",
    ...>   model_identifier: "invalid-model"
    ...> )
    iex> String.contains?(Exception.message(error), "invalid-model")
    true

# `t`

```elixir
@type t() :: %LeXtract.Error.External.TokenizerLoad{
  __exception__: term(),
  bread_crumbs: term(),
  class: term(),
  model_identifier: String.t() | nil,
  path: term(),
  reason: String.t(),
  splode: term(),
  stacktrace: term(),
  vars: term()
}
```

# `exception`

```elixir
@spec exception(opts :: Keyword.t()) :: %LeXtract.Error.External.TokenizerLoad{
  __exception__: term(),
  bread_crumbs: term(),
  class: term(),
  model_identifier: term(),
  path: term(),
  reason: term(),
  splode: term(),
  stacktrace: term(),
  vars: term()
}
```

Create an `Elixir.LeXtract.Error.External.TokenizerLoad` without raising it.

## Keys

- :reason
- :model_identifier

# `message`

```elixir
@spec message(t()) :: String.t()
```

Formats the error message for tokenizer loading failures.

---

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