Last reviewed: 3/23/2024 12:40:16 PM

<throw>

A <throw> element throws an event.

Syntax

<throw event="event"
       eventexpr="expression"
       message="string"
       messageexpr="expression" />

Attributes

event

The event being thrown.

eventexpr

An ECMAScript expression evaluating to the name of the event being thrown.

message

A message string providing additional context about the event being thrown. For the pre-defined events thrown by the platform, the value of the message is platform-dependent. The message is available as the value of a variable within the scope of the catch element.

messageexpr

An ECMAScript expression evaluating to the message string.

Children

none

Parents

<block>, <catch>, <error>, <filled>, <help>, <if>, <noinput>, <nomatch>, and <prompt>.

Variables

none

Example

The following example illustrates using example elements.

<throw name="flavor" expr="'chocolate'"/> 
<throw name="document.mycost" expr="document.mycost+14"/>

Version Information

Supported in: VoiceXML 1.0, VoiceXML 2.0, and VoiceXML 2.1.