Browse Source

fix: avoid throwing from async

nc-fix/meta-first
mertmit 5 months ago
parent
commit
3e28da4d29
  1. 10
      packages/nocodb/src/services/hook-handler.service.ts

10
packages/nocodb/src/services/hook-handler.service.ts

@ -29,6 +29,7 @@ export class HookHandlerService implements OnModuleInit, OnModuleDestroy {
context: NcContext,
{ hookName, prevData, newData, user, viewId, modelId, tnPath },
): Promise<void> {
try {
const view = await View.get(context, viewId);
const model = await Model.get(context, modelId);
@ -136,10 +137,17 @@ export class HookHandlerService implements OnModuleInit, OnModuleDestroy {
}
}
}
} catch (e) {
this.logger.error({
error: e,
details: 'Error while handling hook',
hookName,
});
}
}
onModuleInit(): any {
this.unsubscribe = this.eventEmitter.on(HANDLE_WEBHOOK, async (arg) => {
this.unsubscribe = this.eventEmitter.on(HANDLE_WEBHOOK, (arg) => {
const { context, ...rest } = arg;
return this.handleHooks(context, rest);
});

Loading…
Cancel
Save