Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
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!