Page 1 of 1

Global Error Handling Issues

Posted: Wed Jun 22, 2016 3:57 pm
by Clayton
I'm using the following code ...

Code: Select all

<vxml application="root.vxml" version="2.0">
    <catch event="error.badfetch">
        <log expr="_event" label="error.name"/>
        <log expr="_message" label="error.message"/>
        <audio src="resources/sorry.mp3">I'm sorry.</audio>
        <audio src="resources/technical-difficulties.mp3">It looks like we're experiencing technical difficulties.</audio>
        <goto next="operator.transfer.vxml"/>
    </catch>
    <form>
        <var name="test"/>
        <block>
            <form/>
        </block>
    </form>
</vxml>
... and I can't figure out why the default error handler is catching the badfetch and the one I specified directly in the document is being bypassed.

Can anyone help me figure out why?

Re: Global Error Handling Issues

Posted: Thu Jun 23, 2016 8:59 am
by support
The <catch> tags is for catching events that may happen during the call, for example, trying to fetch a non-existent document. It is not for catching code errors. If you look at your call logs for this app, you'll see a parse error like this:

DocumentParser::FetchDocument - Parse error in file "http://...", line 15, column 15 - Element 'form' is not valid for content model: '(#PCDATA|audio|enumerate|value|assign|clear|data|disconnect|exit|foreach|goto|if|log|prompt|reprompt|return|script|submit|throw|var)*'
errno: 205 uri http://...

Parse errors like this can be avoided and should be caught during QA.