> For the complete documentation index, see [llms.txt](https://docs.plumvoice.com/dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.plumvoice.com/dev/voicexml/tags/error-tag.md).

# \<error>

## \<error> <a href="#error" id="error"></a>

The `<error>` element is short for \<catch event=“error”> and catches all events of type error. Some common error are error.badfetch (failure to fetch remote script) and error.disconnect.hangup (when the user hangs up the phone).

#### Attributes <a href="#attributes" id="attributes"></a>

<table><thead><tr><th width="164.33333333333331">Name</th><th width="167">Data type<select><option value="1a36e478e9d5442784b70d627e18c3f5" label="String" color="blue"></option><option value="53e79c50a7334f5c992c2bf4f4cc1e5b" label="Integer" color="blue"></option><option value="33be561482f041079826c19047a45515" label="Boolean" color="blue"></option></select></th><th>Description</th></tr></thead><tbody><tr><td>count</td><td><span data-option="53e79c50a7334f5c992c2bf4f4cc1e5b">Integer</span></td><td><p>(defaults to 1) The occurrence of the event. The count allows you to handle different occurrences of the same event differently.</p><p></p><p>Each &#x3C;form>, &#x3C;menu>, and form item maintains a counter for each event that occurs while it is being visited; these counters are reset each time the &#x3C;menu> or form item's &#x3C;form> is re-entered. The form-level counters are used in the selection of an event handler for events thrown in a form-level &#x3C;filled>.</p><p></p><p>Counters are incremented against the full event name and every prefix matching event name. For example, occurrence of the event “event.foo.1” increments the counters associated with handlers for “event.foo.1” plus “event.foo” and “event”.</p></td></tr><tr><td>cond</td><td><span data-option="1a36e478e9d5442784b70d627e18c3f5">String</span></td><td>(defaults to true) An expression that must evaluate to true after conversion to Boolean in order for the event to be caught.</td></tr></tbody></table>

#### Notes <a href="#notes" id="notes"></a>

None

### Example

```markup
<?xml version="1.0"?>
<vxml version="2.0">
  <form>
    <block>
      <prompt>
      	Hello. Let's move to another script.
      </prompt>
      <goto next="nonexistant_file.php"/>
    </block>
    <error>
      <prompt>
      	A serious error of type error.badfetch has occurred. Exiting.
      </prompt>
      <exit/>
    </error>
  </form>
</vxml>
```

This script mimics the default functionality for when the IVR fails to fetch a remote file.

The output of the above script would be:

> Computer: Hello. Let's move to another script.\
> Computer: A serious error of type error.badfetch has occurred. Exiting.

### Child Tags

[\<assign>](/dev/voicexml/tags/assign-tag.md), [\<audio>](/dev/voicexml/tags/audio-tag.md), [\<clear>](/dev/voicexml/tags/clear-tag.md), [\<data>](/dev/voicexml/tags/data-tag.md), [\<disconnect>](/dev/voicexml/tags/disconnect-tag.md), [\<enumerate>](/dev/voicexml/tags/enumerate-tag.md), [\<exit>](/dev/voicexml/tags/exit-tag.md), [\<foreach>](/dev/voicexml/tags/foreach-tag.md), [\<goto>](/dev/voicexml/tags/goto-tag.md), [\<if>](/dev/voicexml/tags/if-tag.md), [\<log>](/dev/voicexml/tags/log-tag.md), [\<prompt>](/dev/voicexml/tags/prompt-tag.md), [\<reprompt>](/dev/voicexml/tags/reprompt-tag.md), [\<return>](/dev/voicexml/tags/return-tag.md), [\<script>](/dev/voicexml/tags/script-tag.md), [\<submit>](/dev/voicexml/tags/submit-tag.md), [\<throw>](/dev/voicexml/tags/throw-tag.md), [\<value>](/dev/voicexml/tags/value-tag.md), [\<var>](/dev/voicexml/tags/var-tag.md)

### Parent Tags

[\<field>](/dev/voicexml/tags/field-tag.md), [\<form>](/dev/voicexml/tags/form-tag.md), [\<initial>](/dev/voicexml/tags/initial-tag.md), [\<menu>](/dev/voicexml/tags/menu-tag.md), [\<record>](/dev/voicexml/tags/record-tag.md), [\<subdialog>](/dev/voicexml/tags/subdialog-tag.md), [\<transfer>](/dev/voicexml/tags/transfer-tag.md), [\<vxml>](/dev/voicexml/tags/vxml-tag.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.plumvoice.com/dev/voicexml/tags/error-tag.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
