# throw

Source: https://taxilang.org/docs/language/stdlib/throw

**Full name:** `taxi.stdlib.throw`

## Signature

```taxi
declare function throw(error:Any):Nothing
```

## Description

Throws an error, halting execution. Useful for enforcing invariants inline.

```taxi
find { order: Order } as {
   status: OrderStatus = when {
      OrderStatus == 'INVALID' -> throw('Order status is invalid')
      else -> OrderStatus
   }
}
```
