# `Periodical.Error`
[🔗](https://github.com/joetjen/periodical/blob/main/lib/periodical/error.ex#L1)

Defines the stable, typed failures returned by Periodical.

Every failure carries a machine-readable `:code`, a fixed human-readable
`:message`, and free-form `:details` describing the specific occurrence. The
code is the stable part: match on it rather than on message text.

Each code has a constructor of the same name:

    iex> error = Periodical.Error.overloaded(%{limit: 100})
    iex> {error.code, error.details}
    {:overloaded, %{limit: 100}}

# `t`

```elixir
@type t() :: %Periodical.Error{
  __exception__: true,
  code: atom(),
  details: term(),
  message: String.t()
}
```

An error owned by Periodical.

# `codes`

```elixir
@spec codes() :: [atom()]
```

Returns every code this module defines, for exhaustiveness checks.

# `dependency_unavailable`

```elixir
@spec dependency_unavailable(term()) :: t()
```

Builds the `:dependency_unavailable` error: A configured optional dependency is unavailable.

# `drain_timeout`

```elixir
@spec drain_timeout(term()) :: t()
```

Builds the `:drain_timeout` error: Scheduler drain deadline expired.

# `duplicate_name`

```elixir
@spec duplicate_name(term()) :: t()
```

Builds the `:duplicate_name` error: A schedule with this name already exists.

# `invalid_config`

```elixir
@spec invalid_config(term()) :: t()
```

Builds the `:invalid_config` error: Periodical configuration is invalid.

# `invalid_schedule`

```elixir
@spec invalid_schedule(term()) :: t()
```

Builds the `:invalid_schedule` error: Schedule definition is invalid.

# `overloaded`

```elixir
@spec overloaded(term()) :: t()
```

Builds the `:overloaded` error: Schedule capacity has been reached.

# `schedule_not_found`

```elixir
@spec schedule_not_found(term()) :: t()
```

Builds the `:schedule_not_found` error: Schedule was not found.

# `shutting_down`

```elixir
@spec shutting_down(term()) :: t()
```

Builds the `:shutting_down` error: Scheduler is shutting down.

---

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