Try-catch exception

Follow

Comments

2 comments

  • Avatar
    Marco Mariani

    Hi team,

     

    it seems that if you use throw (not sure if the same happens for not manually generated exception) in a loop, only the first exception is captured by the catch.

    All subsequent exceptions in the loop seem to make the try end but the workflow doesn't  execute the catch branch.

    Thanks,

    Marco

    0
    Comment actions Permalink
  • Avatar
    Dan Richings

    Hi Marco,

    If you throw an error inside a loop, it will break out of the loop and subsequent loop iterations will not execute. The error will be handled by the inner-most executing Try-Catch assuming you have one, if no Try-Catch is present then workflow execution will terminate with your exception.

    If you wish to abort the processing of the current iteration of the loop but not break out of the loop itself, just continue onto the next iteration, the correct activity to use would be GeneralContinue.

    If you wish to abort the processing of the entire loop, the correct activity to use would be Break-While or GeneralBreak.

    If you wish to throw an error and abort processing entirely, then that is where you should use Throw exception.

    Thanks,

    Dan

    0
    Comment actions Permalink

Please sign in to leave a comment.