---
title: "error — Throw error"
description: "iXML command error: Throw error."
canonical_url: "https://www.zeyos.com/ixml/ref/error"
markdown_url: "https://www.zeyos.com/ai/guide/ixml/ref/error.md"
section: "ixml-reference"
authority: "reference"
language: "en"
source_repository: "https://cloud.zeyos.com/__doc/ixmldoc.xml"
source_sha256: "a23f04e6a98628ca3c273c3b8dd2c33c034cfda3e0f00478d8793074fd2f70dd"
---

# error — Throw error

ERROR breaks out of the current control flow by throwing an error with an error message.

An error can be thrown and caught. Code may be surrounded by a TRY statement, to facilitate the catching of potential errors.

### Attributes
- (none)

### Children
- (none)

### Parents
- (not restricted in the reference)

### Result
- (none documented)

### Examples

```xml
<try>
	<set var="name">iXML</set>

	<if value1="$name" func="=" value2="iXML">
		<error>An error has occurred!</error>
	</if>

	<catch var="error">
		<output>$error</output>
	</catch>
</try>

<!-- An error has occurred! -->
```
