Alternative to throw?

Hello

My process workflow downloads different documents in this way:

Try Download Doc 1 catch “Couldn’t download doc1”
Try Download Doc 2 catch “Couldn’t download doc2” …

My robot is linked to a Power Apps that displays the potential error messages to the user

As each document is independant, i am wondering if it’s a good idea to throw an error if the robot fails to download a certain document and it should continue and download the rest ? however, if i don’t use throw, it doesn’t take a screenshot and i don’t want to pollute my proess with screenshot workflows all over

However, i still would like the user to know which document it failed in

the way i send the info to the user is through an http request with the “error message”, and it directly displays in the app

is there an alternative to the throw to be able to send the documents that failed to download to the user and still continue the treatment and take the screenshot ? i’m open to suggestions

thank you

It may be possible to place the entire flow responsible for all downloads within a single try-catch. Specify the exception referring to the download failure and place the user notification flow in this exception. This way you would centralize notifications in a single flow. (In this flow you insert the screenshot activity)

@adext

If each document is independent then there should be no problem to throw ideally it is like a separate transaction always

are you facing any issue with it/.?

cheers

Hi @adext

How about this

Initialize errorMessages as List
Initialize screenshotDirectory

For Each document in documentsList
Try
Attempt to download document
Catch exception
Take screenshot and save to screenshotDirectory
Add “Couldn’t download ” to errorMessages
Send HTTP request with the error message to Power Apps

if i throw an error for a document then the process stops and the other documents are not downloaded

@adext

Are you using ref ? if so then process.xaml is in try catch it should continue…what is your transaction item?

if not useing ref…then have one try catch around the activities inside your loop…so that if download fails try catch inside will catch and continue with next item

cheers

i am not using a queue nor a loop, it’s really a sequence of workflows

doc 1

doc 2

etc

so i cannot use any of the two solutions you provided :frowning:

@adext

Then have individual try catch for each set of activities then…if first fails it just continues with second

cheers