| 3142 | } |
| 3143 | |
| 3144 | function onWorkScheduled(interactions, threadID) { |
| 3145 | var didCatchError = false; |
| 3146 | var caughtError = null; |
| 3147 | subscribers.forEach(function (subscriber) { |
| 3148 | try { |
| 3149 | subscriber.onWorkScheduled(interactions, threadID); |
| 3150 | } catch (error) { |
| 3151 | if (!didCatchError) { |
| 3152 | didCatchError = true; |
| 3153 | caughtError = error; |
| 3154 | } |
| 3155 | } |
| 3156 | }); |
| 3157 | |
| 3158 | if (didCatchError) { |
| 3159 | throw caughtError; |
| 3160 | } |
| 3161 | } |
| 3162 | |
| 3163 | function onWorkStarted(interactions, threadID) { |
| 3164 | var didCatchError = false; |