Skip to main content

Throws an exception with your own message when a condition is true.

Use it in a component for a misconfiguration that argument definitions cannot express, such as missing slot content:

<f:variable name="reviewText" value="{f:slot() -> f:spaceless()}" />
<ui:error when="!{reviewText}" message="ui:productReview needs the review text as slot content." />
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