From 44f686e4f5d42b78d5432b812b62d1bdaf864da7 Mon Sep 17 00:00:00 2001 From: Arda TANRIKULU Date: Tue, 2 Jul 2019 04:02:02 -0400 Subject: [PATCH] Do not call onError in context errors --- packages/core/src/graphql-module.ts | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/packages/core/src/graphql-module.ts b/packages/core/src/graphql-module.ts index 14f79a00f6..2bf81e6ed9 100644 --- a/packages/core/src/graphql-module.ts +++ b/packages/core/src/graphql-module.ts @@ -1020,11 +1020,6 @@ export class GraphQLModule< try { moduleContext = await this.context(info.session, true); } catch (e) { - moduleContext.injector.callHookWithArgsAsync({ - hook: 'onError', - args: [e], - instantiate: true - }); const logger = this.selfLogger; if ('clientError' in logger) { logger.clientError(e); @@ -1036,11 +1031,6 @@ export class GraphQLModule< try { result = await resolver.call(typeResolvers, root, moduleContext, info); } catch (e) { - moduleContext.injector.callHookWithArgsAsync({ - hook: 'onError', - args: [e], - instantiate: true - }); throw e; } return result; @@ -1057,11 +1047,6 @@ export class GraphQLModule< try { moduleContext = await this.context(info.session, true); } catch (e) { - moduleContext.injector.callHookWithArgsAsync({ - hook: 'onError', - args: [e], - instantiate: true - }); const logger = this.selfLogger; if ('clientError' in logger) { logger.clientError(e);