@@ -183,24 +183,44 @@ async function bootstrap() {
183183
184184 if ( config . init ) {
185185 lifecycleHooks . registerGlobalInitHook ( {
186- id : "trigger-dev-worker " ,
186+ id : "config " ,
187187 fn : lifecycleHooksAdapters . createInitHookAdapter ( config . init ) ,
188188 } ) ;
189189 }
190190
191191 if ( config . onStart ) {
192192 lifecycleHooks . registerGlobalStartHook ( {
193- id : "trigger-dev-worker " ,
193+ id : "config " ,
194194 fn : lifecycleHooksAdapters . createStartHookAdapter ( config . onStart ) ,
195195 } ) ;
196196 }
197197
198+ if ( config . onSuccess ) {
199+ lifecycleHooks . registerGlobalSuccessHook ( {
200+ id : "config" ,
201+ fn : lifecycleHooksAdapters . createSuccessHookAdapter ( config . onSuccess ) ,
202+ } ) ;
203+ }
204+
205+ if ( config . onFailure ) {
206+ lifecycleHooks . registerGlobalFailureHook ( {
207+ id : "config" ,
208+ fn : lifecycleHooksAdapters . createFailureHookAdapter ( config . onFailure ) ,
209+ } ) ;
210+ }
211+
212+ if ( handleError ) {
213+ lifecycleHooks . registerGlobalCatchErrorHook ( {
214+ id : "config" ,
215+ fn : lifecycleHooksAdapters . createHandleErrorHookAdapter ( handleError ) ,
216+ } ) ;
217+ }
218+
198219 return {
199220 tracer,
200221 tracingSDK,
201222 consoleInterceptor,
202223 config,
203- handleErrorFn : handleError ,
204224 workerManifest,
205225 } ;
206226}
@@ -242,7 +262,7 @@ const zodIpc = new ZodIpcConnection({
242262 }
243263
244264 try {
245- const { tracer, tracingSDK, consoleInterceptor, config, handleErrorFn , workerManifest } =
265+ const { tracer, tracingSDK, consoleInterceptor, config, workerManifest } =
246266 await bootstrap ( ) ;
247267
248268 _tracingSDK = tracingSDK ;
@@ -359,7 +379,6 @@ const zodIpc = new ZodIpcConnection({
359379 tracingSDK,
360380 consoleInterceptor,
361381 retries : config . retries ,
362- handleErrorFn,
363382 } ) ;
364383
365384 try {
0 commit comments