Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Attention: The Community will be in read-only mode on 12/14/2017 from 12:00 am pacific to 11:30 am.

During this time you will only be able to see content. Other interactions such as posting, replying to questions, or marking content as helpful will be disabled for few hours.

We apologize for the inconvenience while we perform important updates to the Community.

New Member

Checking to see if document exists

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?                  

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Checking to see if document exists

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))

4 REPLIES

Checking to see if document exists

I have handled this error using the DocumentNotFoundException.

New Member

Re: Checking to see if document exists

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

Re: Checking to see if document exists

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))

New Member

Re: Checking to see if document exists

Thanks for your help.

361
Views
0
Helpful
4
Replies
CreatePlease to create content