# `BB.Error.State.Invalid`
[🔗](https://github.com/beam-bots/bb/blob/main/lib/bb/error/state/invalid.ex#L5)

Invalid state reference.

Raised when attempting to transition to or reference a state that
is not defined in the robot's DSL.

# `t`

```elixir
@type t() :: %BB.Error.State.Invalid{
  __exception__: true,
  bread_crumbs: term(),
  class: term(),
  path: term(),
  splode: term(),
  stacktrace: term(),
  state: atom(),
  valid_states: [atom()],
  vars: term()
}
```

# `exception`

```elixir
@spec exception(opts :: Keyword.t()) :: %BB.Error.State.Invalid{
  __exception__: true,
  bread_crumbs: term(),
  class: term(),
  path: term(),
  splode: term(),
  stacktrace: term(),
  state: term(),
  valid_states: term(),
  vars: term()
}
```

Create an `Elixir.BB.Error.State.Invalid` without raising it.

## Keys

- :state
- :valid_states

---

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