<!-- This file is auto-generated by the docs:generate-viewhelper-docs command. Do not edit directly -->

# ui:error

**Reference:** [View Source](https://github.com/jramke/fluid-primitives/tree/main/Classes/ViewHelpers/ErrorViewHelper.php)

Throw an error with a custom message.

This is useful inside components to throw errors for required props or other misconfigurations that you cant handle with argument definitions.

## Example
```html
<ui:error when="!{value}" message="This is an error message." />
```

## Arguments

| Name | Type | Description | Required | Default |
|------|------|-------------|----------|--------|
| `when` | bool | The condition that triggers the exception | Yes | - |
| `message` | string | The exception message | No | 'An error occurred in Fluid.' |
| `code` | int | The exception code | No | 1759132287 |
