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

Operation not allowed in current state.

Raised when attempting an operation that is not permitted in the
robot's current state machine state.

# `t`

```elixir
@type t() :: %BB.Error.State.NotAllowed{
  __exception__: true,
  allowed_states: [atom()],
  bread_crumbs: term(),
  class: term(),
  current_state: atom(),
  operation: atom() | nil,
  path: term(),
  splode: term(),
  stacktrace: term(),
  vars: term()
}
```

# `exception`

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

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

## Keys

- :operation
- :current_state
- :allowed_states

---

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