Page 1 of 1

How may I manage the "error" condition on a "URL Download" ?

Posted: 03 Jan 2019 10:42
by wfrcrd
Hi to everyone, another simple question:

I made an "URL Download" action in a do cicle, and I must stop the cicle when
the "URL Download" action goes to an error condition (for example, the file to download don't exist).
How can I intercept the error condition (in my case, if the file to download don't exist, and then stop the flow) ?
Thank you in advice!

Re: How may I manage the "error" condition on a "URL Downloa

Posted: 03 Jan 2019 17:58
by Desmanto
Add the connection first and change the connection to exception, as shown here : viewtopic.php?f=5&t=7314#p20955
You might want to catch the error by using action Notification on Statusbar and put the error there.

Re: How may I manage the "error" condition on a "URL Downloa

Posted: 03 Jan 2019 21:35
by wfrcrd
Thank you for the answer, I made it in a very simple way:
1) create a standard connection to the download action back to the previous cicle step, wich increments a variable and then perform the download action again
2) create an exception connection from the same download action to another action " stop flow"

so the download action continues with every new element and the first time an element miss, and the download action perform an error, the exception connection
drives to the "stop the flow" action.
It seems working, thanks a lot!

Re: How may I manage the "error" condition on a "URL Downloa

Posted: 04 Jan 2019 09:48
by wfrcrd
I confirm that this way it works,
but if I add another step (a simple script b=b+1 for ex.) after the "exception" connection,
and then an expression to check "b", it gives me an error :

" End executing condition 'Expression: b=3' with return value false and exception Could not convert value '3' to boolean "

this means that (as I suppose) I've not well understood the meaning of the "exception" connection.

Re: How may I manage the "error" condition on a "URL Downloa

Posted: 04 Jan 2019 10:01
by Martin
Comparing values in a script requires two equal signs, otherwise it's an assignment. Changing the script to b==3 should work.

Regards,
Martin

Re: How may I manage the "error" condition on a "URL Downloa

Posted: 04 Jan 2019 11:45
by wfrcrd
Oh , thank you!

(It works!)