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

> pure function error([message: text ]): error_type Unconditionally fail, raising an exception, with an optional message. Ends control flow, enabling one to 

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

FUNCTION

# error

```signature
pure function error([message: text]): error_type
```

Unconditionally fail, raising an exception, with an optional message.

Ends control flow, enabling one to write e.g.

Rell

```
function f(x: integer?): integer {
    if (x == null) {
        rell.error('null argument');
    }
    return x * x; // compiler knows that x cannot be null, so we can write x * x
}
```

`rell.error(message)` is equivalent to `require(false, message)`, except that `rell.error()` has the
additional end-of-control-flow behaviour.

**Parameters**

* **message** — the message for the exception to be thrown

**Throws**

* `exception` — unconditionally

Since 0.14.15

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