diff --git a/src/handlers/event-utils.ts b/src/handlers/event-utils.ts index 2238aef..559acdf 100644 --- a/src/handlers/event-utils.ts +++ b/src/handlers/event-utils.ts @@ -132,6 +132,12 @@ export function buildModules( return Files.buildModuleStream>(input).pipe(assignDefaults(moduleManager)); } + +interface ExecutePayload { + module: Processed; + task: () => Awaitable; + onError: OnError +} /** * Wraps the task in a Result as a try / catch. * if the task is ok, an event is emitted and the stream becomes empty @@ -145,10 +151,8 @@ export function executeModule( { module, task, - }: { - module: Processed; - task: () => Awaitable; - }, + onError + }: ExecutePayload, ) { return of(module).pipe( //converting the task into a promise so rxjs can resolve the Awaitable properly @@ -158,6 +162,9 @@ export function executeModule( emitter.emit('module.activate', SernEmitter.success(module)); return EMPTY; } else { + if(onError) { + + } return throwError(() => SernEmitter.failure(module, result.error)); } }),