Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Uploads getting stuck in the virus scanner. We are investigating.
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator
Creator

REST API data connection error handling so the script will continue in case of error

Hi, 

in my load script we are pulling data from many connections, 

one of the connections is REST API. 

but when the RESP API get error 400,500 etc.. the script fails. 

1. how can i make the script continue even if the API failed?

2. or better is there error handling i can do? like try and catch?

Labels (2)
1 Solution

Accepted Solutions
Highlighted
Specialist II
Specialist II

You can use ErrorMode; you could set it to 0 before that specific load and back to 1 after 

https://help.qlik.com/en-US/sense/November2019/Subsystems/Hub/Content/Sense_Hub/Scripting/ErrorVaria...

 

Argument Description

ErrorMode=1The default setting. The script execution will halt and the user will be prompted for action (non-batch mode).
ErrorMode =0Qlik Sense will simply ignore the failure and continue script execution at the next script statement.
ErrorMode =2

Qlik Sense will trigger an "Execution of script failed..." error message immediately on failure, without prompting the user for action beforehand.

View solution in original post

3 Replies
Highlighted
Specialist II
Specialist II

You can use ErrorMode; you could set it to 0 before that specific load and back to 1 after 

https://help.qlik.com/en-US/sense/November2019/Subsystems/Hub/Content/Sense_Hub/Scripting/ErrorVaria...

 

Argument Description

ErrorMode=1The default setting. The script execution will halt and the user will be prompted for action (non-batch mode).
ErrorMode =0Qlik Sense will simply ignore the failure and continue script execution at the next script statement.
ErrorMode =2

Qlik Sense will trigger an "Execution of script failed..." error message immediately on failure, without prompting the user for action beforehand.

View solution in original post

Highlighted
Creator
Creator

thx!

i see it lets me continue, 

do you know a way also to catch the specific error that i get?