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, context: NcContext,
{ hookName, prevData, newData, user, viewId, modelId, tnPath }, { hookName, prevData, newData, user, viewId, modelId, tnPath },
): Promise<void> { ): Promise<void> {
try {
const view = await View.get(context, viewId); const view = await View.get(context, viewId);
const model = await Model.get(context, modelId); 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 { onModuleInit(): any {
this.unsubscribe = this.eventEmitter.on(HANDLE_WEBHOOK, async (arg) => { this.unsubscribe = this.eventEmitter.on(HANDLE_WEBHOOK, (arg) => {
const { context, ...rest } = arg; const { context, ...rest } = arg;
return this.handleHooks(context, rest); return this.handleHooks(context, rest);
}); });

Loading…
Cancel
Save