Skip to content

Commit

Permalink
Do not call onError in context errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ardatan committed Jul 2, 2019
1 parent 46b40ca commit 44f686e
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions packages/core/src/graphql-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand All @@ -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);
Expand Down

0 comments on commit 44f686e

Please sign in to comment.