# \<throw>

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

The `<throw>` element throws an event. These can be predefined ones or application-defined events.

### Attributes

<table><thead><tr><th width="146.33333333333331">Name</th><th width="166">Data type<select><option value="dc50233231fd42acb344bf6fdf5630d2" label="String" color="blue"></option><option value="571d47b8d0e44cab9fedc865b6dcd19c" label="Integer" color="blue"></option><option value="179e645ed9b84a47897a7ffbd1031381" label="Boolean" color="blue"></option></select></th><th>Description</th></tr></thead><tbody><tr><td>event</td><td><span data-option="dc50233231fd42acb344bf6fdf5630d2">String</span></td><td>The event being thrown.</td></tr><tr><td>eventexpr</td><td><span data-option="dc50233231fd42acb344bf6fdf5630d2">String</span></td><td>An ECMAScript expression evaluating to the name of the event being thrown.</td></tr><tr><td>message</td><td><span data-option="dc50233231fd42acb344bf6fdf5630d2">String</span></td><td>A message string providing additional context about the event being thrown. The message is available as the value of “_message” within the scope of the catch element.</td></tr><tr><td>messageexpr</td><td><span data-option="dc50233231fd42acb344bf6fdf5630d2">String</span></td><td>An ECMAScript expression evaluating to the message string.</td></tr></tbody></table>

### Notes

Exactly one of “event” and “eventexpr” must be specified. Exactly one of “message” and “messageexpr” may be specified.

### Example

```markup
<?xml version="1.0"?>
<vxml version="2.0">
  <form>
    <block>
      <throw event="myevent" message="hello, world!"/>
    </block>
    <catch event="myevent">
      <prompt>
        Caught my event with the following message:
        <break time="1s"/>
        <value expr="_message"/>
      </prompt>
    </catch>
  </form>
</vxml>
```

The output of the above script would be:

> Computer: Caught my event with the following message:\
> Computer: hello, world!

### Child Tags

None

### Parent Tags

[\<block>](https://docs.plumvoice.com/dev/voicexml/tags/block-tag), [\<catch>](https://docs.plumvoice.com/dev/voicexml/tags/catch-tag), [\<error>](https://docs.plumvoice.com/dev/voicexml/tags/error-tag), [\<filled>](https://docs.plumvoice.com/dev/voicexml/tags/filled-tag), [\<foreach>](https://docs.plumvoice.com/dev/voicexml/tags/foreach-tag), [\<help>](https://docs.plumvoice.com/dev/voicexml/tags/help-tag), [\<if>](https://docs.plumvoice.com/dev/voicexml/tags/if-tag), [\<noinput>](https://docs.plumvoice.com/dev/voicexml/tags/noinput-tag), [\<nomatch>](https://docs.plumvoice.com/dev/voicexml/tags/nomatch-tag)
