Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

General script error handling

I am currently outputting a table to a txt file on a network drive using the following command:

Store Table Into "\\Folder\File.csv" (txt);

This works fine unless another user has the file open when the script runs (and therefore the script cannot write to the file), I get a general script error, and the script ends.

What I would expect to be able to do is handle the error, but I can't; the script exits on the general script error without any opportunity to handle it.

How can I resolve this issue?

Thanks!

2 Replies
datanibbler
Champion
Champion

Hi Daniel,

using the variable ErrorMode you can first make sure that the script will not exit upon hitting on that error.

=> That will let you proceed, and you can use the variable ScriptErrorCount to determine whether or not your command has succeeded.

=> In case it hasn't because someone has it open, you could, like, take a timestamp and then make the script try again after a certain nr. of minutes has passed. Unfortunately there doesn't seem to be sth like a >Wait< function, but I'm sure that you can find a way to do that.

Not applicable
Author

Thanks - I have set the ErrorMode variable to ensure it doesn't exit; but it exits anyway!