# `Predicator.Errors.UndefinedVariableError`
[🔗](https://github.com/riddler/predicator-ex/blob/v9.4.1/lib/predicator/errors/undefined_variable_error.ex#L1)

Error struct for undefined variable errors in Predicator evaluation.

This error occurs when trying to access a variable that doesn't exist in the evaluation context.

## Fields

- `message` - Human-readable error description
- `variable` - The name of the undefined variable
- `position` - `{line, column}` of the source token that produced the failing
  instruction, when a position table was available (optional)
- `span` - the source text the failing instruction's AST node covers, when the
  program was compiled with spans (optional). `position` names the token to
  blame; `span` is what to underline.

## Examples

    %Predicator.Errors.UndefinedVariableError{
      message: "Undefined variable: limit",
      variable: "limit"
    }

    %Predicator.Errors.UndefinedVariableError{
      message: "Undefined variable: user.profile.settings",
      variable: "user.profile.settings"
    }

# `t`

```elixir
@type t() :: %Predicator.Errors.UndefinedVariableError{
  message: binary(),
  position: Predicator.Types.position() | nil,
  span: Predicator.Types.span() | nil,
  variable: binary()
}
```

# `new`

```elixir
@spec new(binary()) :: t()
```

Creates an undefined variable error.

---

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