Plum DEV Documentation
voicexml:tags:error

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
voicexml:tags:error [2014/05/21 13:24]
adam [<error>]
voicexml:tags:error [2015/07/31 14:13]
admin [<error>]
Line 1: Line 1:
- +{{description>​‹error› VoiceXML tag details, attributes and VXML code example | The error element catches all events with an error type.}} 
-=====<​error>​=====+======<​error>​======
  
 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). 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).
Line 12: Line 12:
  
 ====Example==== ====Example====
 +
 <​code>​ <​code>​
 <?xml version="​1.0"?>​ <?xml version="​1.0"?>​
Line 17: Line 18:
   <​form>​   <​form>​
     <​block>​     <​block>​
-      <throw event="​error"​ message="oh no, there was an error."/>​+      <prompt>​ 
 +      Hello. Let's move to another script. 
 +      </​prompt>​ 
 +      <goto next="nonexistant_file.php"/>
     </​block>​     </​block>​
-    <!-- The "​error"​ tag is shorthand for a "​catch"​ tag that catches an --> 
-    <!-- event named "​error"​. --> 
     <​error>​     <​error>​
       <​prompt>​       <​prompt>​
-        Caught my error event with the following message: +      A serious ​error of type error.badfetch has occurred. Exiting.
-        <break time="​1s"/>​ +
-        <value expr="​_message"/>​+
       </​prompt>​       </​prompt>​
 +      <​exit/>​
     </​error>​     </​error>​
   </​form>​   </​form>​
 </​vxml>​ </​vxml>​
 </​code>​ </​code>​
 +
 +This script mimics the default functionality for when the IVR fails to fetch a remote file. \\
  
 The output of the above script would be: The output of the above script would be:
  
-Computer: ​Caught my error event with the following message: ​\\ +Computer: ​Hello. Let's move to another script. ​\\ 
-Computer: ​oh no, there was an error.+Computer: ​A serious error of type error.badfetch has occurred. Exiting. \\