mirror of
https://github.com/sern-handler/handler
synced 2026-06-06 01:16:55 +00:00
fixregres
This commit is contained in:
@@ -41,14 +41,19 @@ export function executeModule(emitter: Emitter, { module, args } : ExecutePayloa
|
||||
//do not await. this will block sern
|
||||
|
||||
const moduleCalled = wrapAsync(async () => {
|
||||
return module.execute(...args);
|
||||
console.log(module)
|
||||
return module.execute(...args);
|
||||
})
|
||||
moduleCalled
|
||||
.then(() => {
|
||||
emitter.emit('module.activate', resultPayload('success', module) )
|
||||
console.log('success execute')
|
||||
emitter.emit('module.activate', resultPayload('success', module))
|
||||
})
|
||||
.catch(err => {
|
||||
emitter.emit('error', resultPayload('failure', module, err))
|
||||
console.log('err', err)
|
||||
if(!emitter.emit('error', resultPayload('failure', module, err))) {
|
||||
console.error(err)
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
|
||||
@@ -55,6 +55,6 @@ export function interactionHandler(deps: UnpackedDependencies, defaultPrefix?: s
|
||||
payload.args[1].state = result.value
|
||||
|
||||
// note: do not await this. will be blocking if long task (ie waiting for modal input)
|
||||
executeModule(reporter, { module, args: payload.args });
|
||||
executeModule(reporter, payload);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user