08-26-2013 09:36 AM - edited 03-14-2019 12:18 PM
In the script I want to check to see if a .txt file exists in the repository.
For XML files I see you can catch an exception off the GetXML step - the first time I'm using the document holding the .txt file is converting it to a string, which throws a nested filenotfound exception if the file isn't in the repo, which is perfect but I need to find a way to catch this. I tried the OnException GoTo step but none of the exceptions I tried worked.
Any ideas?
Solved! Go to Solution.
08-26-2013 10:56 AM
Ryan,
I set up the scenerio you described above in my lab and I received the same error. The document not found exceptions did not catch these errors. By looking through the MIVR logs, I found that the actual error it was encountering was com.cisco.expression.ExpressionTargetException. Try catching this error.
402285: Aug 26 12:47:11.474 CDT %MIVR-SS_CM-7-UNK:ICDContactAdapter:contactAborted - This call was aborted. The exception is com.cisco.expression.ExpressionTargetException: unable to generate a string from document; nested exception is:
java.io.FileNotFoundException: mydoc.txt (No such file or directory) (line: 1, col: 1)
402286: Aug 26 12:47:11.484 CDT %MIVR-SS_RM-7-UNK:Processing msg: SessionTerminatedMsg (Rsrc:null ID:10001/1 Type:IAQ Cause:INVALID Abort Exception:com.cisco.expression.ExpressionTargetException: unable to generate a string from document; nested exception is:
java.io.FileNotFoundException: mydoc.txt (No such file or directory) (line: 1, col: 1))
08-26-2013 10:17 AM
I have handled this error using the DocumentNotFoundException.
08-26-2013 10:26 AM
I tried that exception as well as the fileNotFound Exception with no luck.
The Document variable is
strMunsterCBFilePath = "MunsterCallBackFile.txt" + appended date (so a new one will be created each day with the first call)
docMunsterCallBackFile = DOC[strMunsterCBFilePath]
The step that throws the exception
strCallback = (String) docMunsterCallBackFile
08-26-2013 10:56 AM
Ryan,
I set up the scenerio you described above in my lab and I received the same error. The document not found exceptions did not catch these errors. By looking through the MIVR logs, I found that the actual error it was encountering was com.cisco.expression.ExpressionTargetException. Try catching this error.
402285: Aug 26 12:47:11.474 CDT %MIVR-SS_CM-7-UNK:ICDContactAdapter:contactAborted - This call was aborted. The exception is com.cisco.expression.ExpressionTargetException: unable to generate a string from document; nested exception is:
java.io.FileNotFoundException: mydoc.txt (No such file or directory) (line: 1, col: 1)
402286: Aug 26 12:47:11.484 CDT %MIVR-SS_RM-7-UNK:Processing msg: SessionTerminatedMsg (Rsrc:null ID:10001/1 Type:IAQ Cause:INVALID Abort Exception:com.cisco.expression.ExpressionTargetException: unable to generate a string from document; nested exception is:
java.io.FileNotFoundException: mydoc.txt (No such file or directory) (line: 1, col: 1))
08-26-2013 11:17 AM
Thanks for your help.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide