loop of geoprocessing tasks, skip the error?

87
2
Jump to solution
01-23-2020 02:42 PM
Highlighted
Regular Contributor

I'm running a loop of geoprocessing tasks and save them in an array

promisesSeg.push(this.gpSegment_from_PM.execute(params_segment));

When all geoprocessing tasks are completed then it continue on...

 Promise.all(promisesSeg).then(function (results) {
-------
---------

However, if one set of params lead to a geoprocessing error, it creates an error and terminates further processing.

Is there a way to by-pass the error and continue on with the rest of the sets of params?

Hope it makes sense.

Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Regular Contributor

THank you. Actually, I had to re-think the process and remove the promises. Since I was using a sync geoprocessing opeation which is already a deferred action, I didn't the need the promise. It is a lot simpler to catch errors.

View solution in original post

Reply
0 Kudos
2 Replies
Highlighted
MVP Regular Contributor

Hi,

I dont know if I'm misinterpreting the question so apologies if this obvious.

Try:

    Run your iteration

Except:

    continue

Reply
0 Kudos
Highlighted
Regular Contributor

THank you. Actually, I had to re-think the process and remove the promises. Since I was using a sync geoprocessing opeation which is already a deferred action, I didn't the need the promise. It is a lot simpler to catch errors.

View solution in original post

Reply
0 Kudos