# `AshOban.Errors.SnoozeJob`
[🔗](https://github.com/ash-project/ash_oban/blob/v0.10.3/lib/errors/snooze_job.ex#L5)

Raise or return this error from an action to snooze the Oban job.

Snoozing re-schedules the job to run again after a delay without consuming
a retry attempt. This is useful for transient conditions such as rate limits
or temporary external service unavailability.

Works from both the main action and the `on_error` action of a trigger, as
well as from scheduled actions.

## Fields

  * `snooze_for` - integer number of seconds to delay before retrying

## Examples

    # Via raise (works anywhere in action code):
    raise AshOban.Errors.SnoozeJob, snooze_for: 60

    # Via add_error (idiomatic inside a change function):
    Ash.Changeset.add_error(changeset, AshOban.Errors.SnoozeJob.exception(snooze_for: 60))

    # Via error tuple return:
    {:error, AshOban.Errors.SnoozeJob.exception(snooze_for: 30)}

# `exception`

```elixir
@spec exception(opts :: Keyword.t()) :: %AshOban.Errors.SnoozeJob{
  __exception__: true,
  bread_crumbs: term(),
  class: term(),
  path: term(),
  snooze_for: term(),
  splode: term(),
  stacktrace: term(),
  vars: term()
}
```

Create an `Elixir.AshOban.Errors.SnoozeJob` without raising it.

## Keys

- :snooze_for

---

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