| 3180 | } |
| 3181 | |
| 3182 | function onWorkStopped(interactions, threadID) { |
| 3183 | var didCatchError = false; |
| 3184 | var caughtError = null; |
| 3185 | subscribers.forEach(function (subscriber) { |
| 3186 | try { |
| 3187 | subscriber.onWorkStopped(interactions, threadID); |
| 3188 | } catch (error) { |
| 3189 | if (!didCatchError) { |
| 3190 | didCatchError = true; |
| 3191 | caughtError = error; |
| 3192 | } |
| 3193 | } |
| 3194 | }); |
| 3195 | |
| 3196 | if (didCatchError) { |
| 3197 | throw caughtError; |
| 3198 | } |
| 3199 | } |
| 3200 | |
| 3201 | function onWorkCanceled(interactions, threadID) { |
| 3202 | var didCatchError = false; |