# `Mutare.EnvironmentError`
[🔗](https://github.com/foxbenjaminfox/mutare/blob/v0.2.1/lib/mutare/environment_error.ex#L1)

A plugin's declared environment is not satisfied: a module it listed in
`c:Mutare.Mutator.required_modules/0` is not loadable in the Mutare process.

Raised once at startup — when a `:mutators` entry is resolved to a
`Mutare.Mutator.Spec`, or an `:extensions` entry is validated by
`Mutare.Extension.validate!/1` — before any source is read, so a plugin whose
routing would silently register against nothing fails loudly instead. The
message is core-owned and names the plugin, the missing modules, and the
deployment requirement.

Structured fields:

  * `:plugin` — the plugin module whose requirement failed;
  * `:missing` — the declared modules that are not loadable (a subset of the
    plugin's `required_modules/0`).

# `t`

```elixir
@type t() :: %Mutare.EnvironmentError{
  __exception__: true,
  missing: [module()],
  plugin: module()
}
```

# `verify!`

```elixir
@spec verify!(module()) :: :ok
```

Verifies `plugin`'s declared environment, raising when it is not satisfied.

When `plugin` exports `required_modules/0` (see
`c:Mutare.Mutator.required_modules/0`), each declared module is checked
loadable (`Code.ensure_loaded?/1`); any missing module raises this error. A
module without the callback — or one that is itself not loadable, which other
validation reports — passes unchecked. Raises `ArgumentError` when the
callback returns anything but a list of modules.

---

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