I am currently writing a script to verify if an XML file exists to parse the contents. The On Exception (FileNotFoundException) does not seem to work. The flow doesnt follow the goto statement. When running a debug the warning window does come up with a "java.io.FileNotFoundException" though.
The below link may also assist you with questions you have regarding your script:
Yes, I eventually figured it out. IPCC throws a different exception not FileNotFoundException. I believe it's com.cisco.file.FileException but it's been a while. I'll see if I can go through some of my older scripts and find the exact exception to look for.
I think I also tried com.cisco.file.FileException without any success.
If you can check your older scripts, it would be greatly appreciated.
Ah ha, found it. What I did was:
On Exception (DocumentException) Goto "LABEL"
docObj = Create XML Document (DOC["status.xml")
stateVar = Get XML Document Data (docObj, "/descendant:state"
When the Get XML document data function runs it will throw a DocumentException even though the CRS editor reports a "java.io.FileNotFoundException".
I tried raising the issue with Cisco but didn't get too far.
Just curious to know if one of you have ever seen some documentation about these exceptions.
Having information like What exactly are each exception and when they are thrown would be really helpfull.
I understand that it is a good thing to be able to catch these exception, but without knowing the nature of each one...
For my part, I'm still trying to find out how I could catch exception thrown when a script fail to launch a VXML application.
I use the create document step followed by a VoiceBrowser step. I
If the server that is hosting my vxml application is not available, I want to be able to handle it.
I know that if I use the On Exception with the com.cisco.app.ApplicationException I catch it, but I also
catch all other exceptions. It is then a catch all, wich is not usefull for me because I need to distinguish.
As Mark and Michael have shown in their previous post, there is no direct relation between the exception shown
in the log files and the exceptions listed in the "On Exception" step.
In my situation, I can see in the log files that a com.cisco.voicebrowser.VBEvent, error.badfetch is thrown.
I tried to use the "On Exception" step to catch the folowing exception without luck:
In my particular situation, The VXML event called "error.badfetch" is specific to VXML and not to the CRS.
I know that I can catch this exception from a VXML application, but in this particular exception, the Cisco's VoiceBrowser
can't even find the application.
I think I can workaround this problem by having a small VXML application located on the CRS to launch my real application.
This small VXML application would indeed catch the "error.badfetch" event and return the error to my CRS Script.
But with this solution, I feel that I'm doing too much work that I shouldn't.
I found no documentation on exception specifics. I'd like the developers of the CRS editor to review how they display the execeptions within a debug session. The exceptions displayed in a debug session appear to display the "base" exception rather then the top-level(com.cisco ones) object exception.
did you find a way to detect when Get XML Document Data returns nothing to a string. If I access a string I get an exception about nullstring, but I can't seem to find the correct exception.