# require · Rell standard library · Chromia Docs (concept)

> pure function require(value: boolean , [message: text ]): unit Asserts a boolean condition. Parameters value — the boolean condition to check message — the

Source: https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/require/

FUNCTION

# require

```signature
pure function require(value: boolean, [message: text]): unit
```

Asserts a boolean condition.

**Parameters**

* **value** — the boolean condition to check
* **message** — the message for the exception to be thrown if the condition is false

**Throws**

* `exception` — if the provided condition is false

Since 0.6.0

---

```signature
pure function require<T>(value: T?, [message: text]): T
```

Asserts that a value is not `null`.

**Parameters**

* **value** — the value to check, and returned if it is not `null`
* **message** — the error message to be thrown if the value is `null`

**Returns**

the passed `value`, but with type cast from `T?` to `T`

**Throws**

* `exception` — if the provided value is `null`

Since 0.6.0

[View this page on docs.chromia.com](https://docs.chromia.com/pages/rell-stdlib/-rell%20-system%20-library/%5Broot%5D/require.html)Generated API reference, mirrored from the live docs
