Skip to content

Commit 44f686e

Browse files
committed
Do not call onError in context errors
1 parent 46b40ca commit 44f686e

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

packages/core/src/graphql-module.ts

-15
Original file line numberDiff line numberDiff line change
@@ -1020,11 +1020,6 @@ export class GraphQLModule<
10201020
try {
10211021
moduleContext = await this.context(info.session, true);
10221022
} catch (e) {
1023-
moduleContext.injector.callHookWithArgsAsync({
1024-
hook: 'onError',
1025-
args: [e],
1026-
instantiate: true
1027-
});
10281023
const logger = this.selfLogger;
10291024
if ('clientError' in logger) {
10301025
logger.clientError(e);
@@ -1036,11 +1031,6 @@ export class GraphQLModule<
10361031
try {
10371032
result = await resolver.call(typeResolvers, root, moduleContext, info);
10381033
} catch (e) {
1039-
moduleContext.injector.callHookWithArgsAsync({
1040-
hook: 'onError',
1041-
args: [e],
1042-
instantiate: true
1043-
});
10441034
throw e;
10451035
}
10461036
return result;
@@ -1057,11 +1047,6 @@ export class GraphQLModule<
10571047
try {
10581048
moduleContext = await this.context(info.session, true);
10591049
} catch (e) {
1060-
moduleContext.injector.callHookWithArgsAsync({
1061-
hook: 'onError',
1062-
args: [e],
1063-
instantiate: true
1064-
});
10651050
const logger = this.selfLogger;
10661051
if ('clientError' in logger) {
10671052
logger.clientError(e);

0 commit comments

Comments
 (0)