Voxeo Documentation - <error> Element

The <error> element is shorthand for the <catch event="error"> element, and catches all events that begin with error. For more information, see Exceptions and Errors.

Syntax

The following code example shows the syntax for the <error> element.

<error cond="myCondCDATA" count="myCountCDATA">

Attribute Details

The following table describes the attributes for the <error> element.

cond

Required: false

Type: CDATA

Default: true

Specifies an expression which can be evaluated to true or false. The value of the cond attribute must evaluate to true for any enclosed operations to be performed.

Valid Values: An ECMAScript Expression that evaluates to true or false.

count

Required: false

Type: CDATA

Default: none

Specifies the number of errors of this type that should have occurred for the enclosed operations to be performed.

When an event is thrown for the first time, the <error> element with the count attribute set to " 1 " is executed. On the second instance of the same event, the FIA looks for an <error> element with the count attribute set to " 2 ". If none exists, the <error> element with the count attribute set to " 1 " is executed again.

Shadow Variables

The following table describes the shadow variables for the <error> element.

_event

Contains the event name that caused the exception. This variable lets the developer log or submit the resultant exception or error to a database, or to save it to another local variable.

_message

Contains the value of any user-defined message that is explicitly thrown. Currently, Voxeo has no platform-defined messages for any standard events, such as error.badfetch or error.semantic, so any caught messages must be user-defined.

Parents

<field> <form> <initial> <menu> <record> <subdialog> <transfer> <vxml>

Children

<assign> <audio> <clear> <disconnect> <enumerate> <exit> <goto> <if> <log> <prompt> <reprompt> <return> <script> <submit> <throw> <value> <var>

Code Samples

The following code samples show use of the <error> element.

<!-- Error count-cond sample -->

<?xml version="1.0" encoding="UTF-8"?>

<vxml version="2.1">

 

<form id="F1">

<error count="1" cond="false">

<prompt>

This handler will not get filled, as the condition is set to false.

</prompt>

</error>

 

<error count="1" cond="true">

<prompt>

We have caught the first error.

</prompt>

<throw event="error.AnotherError" />

</error>

 

<error count="2" cond="true">

<prompt>

We have now caught the second error.

</prompt>

</error>

 

<block>

<prompt>

Preparing to throw the error.

</prompt>

<throw event="error.MyError" />

</block>

</form>

</vxml>

 

<!-- Error-shadowvariables sample -->

<?xml version="1.0" encoding="UTF-8"?>

<vxml version="2.1">

 

<error>

<prompt>

The message is <value expr="_message" />.

The event is <value expr="_event" />.

</prompt>

</error>

 

<form id="F1">

<block>

<prompt>

Hey, lets throw an error, what do you say?

</prompt>

<throw event="error.MyError" message="'hey its an error'" />

</block>

</form>

</vxml>

See Also

VoiceXML Development Guide v2.1 Overview

Element Summary

Voxeo Support

 

The <error> element is shorthand for the <catch event="error"> element, and catches all events that begin with error. For more information, see <error> Element.

 

An event corresponds to a specific situation that may occur within an application, for example, in a voice application, a caller has not providing any input, a NoInput event, or the back-end is not available, an Error Connector event. Event handling can be utilized to handle these situations.

 

The <error> element is shorthand for the <catch event="error"> element, and catches all events that begin with error. For more information, see <error> Element.

 

The <error> element is shorthand for the <catch event="error"> element, and catches all events that begin with error. For more information, see <error> Element.

 

The <error> element is shorthand for the <catch event="error"> element, and catches all events that begin with error. For more information, see <error> Element.

 

The <error> element is shorthand for the <catch event="error"> element, and catches all events that begin with error. For more information, see <error> Element.

 

The <error> element is shorthand for the <catch event="error"> element, and catches all events that begin with error. For more information, see <error> Element.

 

The <error> element is shorthand for the <catch event="error"> element, and catches all events that begin with error. For more information, see <error> Element.

 
Voxeo Corporation is a technology company that specializes in providing development platforms for unified customer experience as self-service and unified communications using real-time communications applications. Voxeo's products are also available as a SaaS platform as cloud-based services using on-premise software in a private cloud, or hybrid clouds that combine both on-demand public-cloud and on-premise components. For more information, see Voxeo.com.

 

The <field> element facilitates a dialog that allows the interpreter to collect information from the user. For more information, see <field> Element.

 

The <form> element is a container for all field items, such as a <field> element or a <subdialog> element, and for all control items, such as a <block> element or an <initial> element. For more information, see <form> Element.

 

The <initial> element is used in mixed-initiative dialogs, in which the first utterances from the caller dictate application flow. This element allows the caller to fill in form-wide information with only one utterance. For more information, see <initial> Element.

 

The <menu> element is a shorthand element that emulates the <field>, <grammar>, and <goto> elements. The <menu> element defines a set of choices for a caller, and allows for both implied DTMF and voice grammars. For more information, see <menu> Element.

 

The <record> element is an input item that records audio from the caller. For more information, see <record> Element.

 

The <subdialog> element is used to invoke a called dialog, known as a subdialog. Subdialogs provide a method for reusing common dialogs within an independent application context. For more information, see <subdialog> Element.

 

The <transfer> element is used to transition the caller to another destination. For more information, see <transfer> Element.

 

The <vxml> element is the initial declaration that defines a document as a VoiceXML application. For more information, see <vxml> Element.

 

The <assign> element is used to explicitly assign a value to a variable. For more information, see <assign> Element.

 

The <audio> element allows you to play an audio sound file in your application. For more information, see <audio> Element.

 

The <clear> element is used to set any existing VoiceXML variable or element guard variables, such as any user-defined variable set with the <var> or <assign> elements, to an undefined value. For more information, see <clear> Element.

 

The <disconnect> element is used to programmatically disconnect the caller from the voice application. For more information, see <disconnect> Element.

 

The <enumerate> element is used to read a list of menu choices to the caller, using either TTS or a user-defined audio file. For more information, see <enumerate> Element.

 

The <exit> element terminates the current dialog and exits the browser. For more information, see <exit> Element.

 

The <goto> element is used to transition application execution to another element or document. For more information, see <goto> Element.

 

The <if> element provides a method to utilize conditional logic expressions to change the control flow within the application based on user utterances, variable values, or events. For more information, see <if> Element.

 

The <log> element allows the application to generate a logging or debug message to Prophecy Log Viewer. For more information, see <log> Element.

 

The <prompt> element allows the developer to output synthesized text-to-speech content to the caller. For more information, see <prompt> Element.

 

The <reprompt> element is used to replay to most recent prompt and listen again for caller input. For more information, see <reprompt> Element.

 

The <return> element is used to terminate a subdialog and return control to the main dialog. For more information, see <return> Element.

 

The <script> element is used to specify a block of client-side ECMAScript code. For more information, see <script> Element.

 

The <submit> element is used to submit information and then transition to the document sent back in the response. For more information, see <submit> Element.

 

The <throw> element throws an event that can be caught and handled with the <catch> element. For more information, see <throw> Element.

 

The <value> element is used to insert the value of a variable into a prompt. For more information, see <value> Element.

 

The <var> element is used to declare a VoiceXML variable within the scope specified by the parent element. For more information, see <var> Element.

 

The <error> element is shorthand for the <catch event="error"> element, and catches all events that begin with error. For more information, see <error> Element.

Voxeo Documentation

     Voxeo Documentation Overview
  Evolution Developer Portal Documentation
  Voxeo CXP Documentation
  Prophecy Documentation
  XML Development Languages Documentation
  VoiceXML 2.1 Development Guide
     VoiceXML Development Guide v2.1 Overview
     Platform Overview
     Creating an Application
     Voxeo File Manager
     Caching Tips and Techniques
     Cache Manager API
     Security Information
  Learning VoiceXML 2.1
  Best Practices
  Debugging Techniques
  Exceptions and Errors
  VoiceXML 2.1 Porting Guide
  VoiceXML Variables
  All Things Audio
  Outbound Dialing
  Property Guide
  GSL Grammars
  grXML Grammars
     Custom Features
     External References
  Text-To-Speech Guide
     VoIP Dialing
     Voxeo Designer User Interface
  Element Reference Guide
     Element Summary
     <assign> Element
     <audio> Element
     <block> Element
     <break> Element
     <catch> Element
     <choice> Element
     <clear> Element
     <data> Element
     <disconnect> Element
     <else> Element
     <elseif> Element
     <emphasis> Element
     <enumerate> Element
     <error> Element
     <example> Element
     <exit> Element
     <field> Element
     <filled> Element
     <foreach> Element
     <form> Element
     <goto> Element
     <grammar> Element
     <help> Element
     <if> Element
     <initial> Element
     <item> Element
     <link> Element
     <log> Element
     <mark> Element
     <media> Element
     <menu> Element
     <meta> Element
     <noinput> Element
     <nomatch> Element
     <one-of> Element
     <option> Element
     <paragraph> Element
     <param> Element
     <phoneme> Element
     <prompt> Element
     <property> Element
     <prosody> Element
     <record> Element
     <reprompt> Element
     <return> Element
     <rule> Element
     <ruleref> Element
     <say-as> Element
     <script> Element
     <sentence> Element
     <sub> Element
     <subdialog> Element
     <submit> Element
     <tag> Element
     <throw> Element
     <token> Element
     <transfer> Element
     <value> Element
     <var> Element
     <voxeo:logcontrol> Element
     <voxeo:recordcall> Element
     <vxml> Element
  CCXML 1.0 Development Guide
  CallXML 3.0 Development Guide
  Voxeo Support
     Support Quick Reference
  Registering for an Account
  Self-Help Tools
  Collecting Information
  Evolution Ticketing System
     Submitting a Support Request
     Escalating a Support Request
  Software Lifecycle and Support Policies
  Getting Further Assistance
  Voxeo Glossary
  Help on Help