Home > Articles > Web Services > XML

  • Print
  • + Share This
This chapter is from the book

This chapter is from the book

3.13 error

Element type



cond | count


field | form | initial | menu | object | record | subdialog | transfer | vxml


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


Shorthand for catching an error event. The contained event-handling code has access to the following variables:


The name of the event being handled.


The message string set by the throw element.


<!ELEMENT error (%executable.content;)* >
<!ATTLIST error
  %event.handler.attrs; >

Language model



cond : expression = true

This event handler will only be executed if this ECMAScript expression evaluates to true.

count : integer

The event handler should be run only when the counter associated with a menu, form, or form item is equal to the quantity specified by this attribute. In the case where there is no count value equal to the counter, then the error with the lowest count value, which is greater than the counter, will be selected. When the counter is greater than all count values, the catch with the highest count value will be selected.



The code to be run to handle the thrown event, assuming the conditions specified by the count and cond attributes are met.


Example 3-15 An error defining handling behavior for the badfile form

<?xml version="1.0" encoding="iso-8859-1"?>
<vxml version="1.0">
  <error count="1">
      Here we catch any errors. It appears we have caught a 
      <value expr="_event"/> event. Additional information includes
      <value expr="_message"/>.
    <goto next="#badfile"/>
  <error count="2">
    <prompt>This time we will exit.</prompt>
  <form id="badfile">
    <block><audio src="badfilename.au"/></block>
  • + Share This
  • 🔖 Save To Your Account