[**Documentation**](../../../../README)

***

[Documentation](../../../../README) / [@zerotal/orm](../../README) / [index](../README) / RejectTransition

# Type Alias: RejectTransition

> **RejectTransition** = (`reason`) => `never`

Defined in: [packages/orm/src/model/State.ts:37](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/orm/src/model/State.ts#L37)

Reject the in-flight transition with a human-readable reason. Throws a [StateError](../classes/StateError)
pre-populated with the model name and the from/to states, so a guard doesn't have to
construct the error itself:

  guard: async (order, reject) => {
    if (!order.paid) reject("Can't ship an unpaid order.");
  }

## Parameters

### reason

`string`

## Returns

`never`
