> ## Documentation Index
> Fetch the complete documentation index at: https://docs.arc.cdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# arc:validate

> Use arc:validate to throw an error if a required attribute is missing from an item, with a configurable error code and description.

export const siteNameShort = "Arc";

Use the `arc:validate` keyword to throw an error if a required value is missing.

## Parameters

* **item**: The item that contains the attribute to validate.
* **attr**: The attribute to validate. If the attribute does not exist, an error is thrown.
* **code**: The error code to throw if validation fails. Default: `arc:validate`.
* **desc**: The error description to throw if validation fails. The default message is that the specified attribute is required.

## Example

Throw a more specific message if the `_query` item does not contain the `Id` attribute:

```xml theme={null}
<arc:validate attr="_query.Id"   desc="The Id is required to delete."/>
```

## See Also

* [arc:throw](./op-arc-throw): Raise an error (exception) from within a script.
