| 3161 | } |
| 3162 | |
| 3163 | function onWorkStarted(interactions, threadID) { |
| 3164 | var didCatchError = false; |
| 3165 | var caughtError = null; |
| 3166 | subscribers.forEach(function (subscriber) { |
| 3167 | try { |
| 3168 | subscriber.onWorkStarted(interactions, threadID); |
| 3169 | } catch (error) { |
| 3170 | if (!didCatchError) { |
| 3171 | didCatchError = true; |
| 3172 | caughtError = error; |
| 3173 | } |
| 3174 | } |
| 3175 | }); |
| 3176 | |
| 3177 | if (didCatchError) { |
| 3178 | throw caughtError; |
| 3179 | } |
| 3180 | } |
| 3181 | |
| 3182 | function onWorkStopped(interactions, threadID) { |
| 3183 | var didCatchError = false; |