diff --git a/packages/sentry-plugin/src/sentry.filter.ts b/packages/sentry-plugin/src/sentry.filter.ts index c69ef47c42..0ddce6c8d8 100644 --- a/packages/sentry-plugin/src/sentry.filter.ts +++ b/packages/sentry-plugin/src/sentry.filter.ts @@ -26,7 +26,7 @@ export class SentryExceptionsFilter extends ExceptionLoggerFilter { if (variables) { setContext('GraphQL Error Variables', variables); } - this.sentryService.captureException(exception); + this.sentryService.captureException(exception,'true'); } return super.catch(exception, host); } diff --git a/packages/sentry-plugin/src/sentry.service.ts b/packages/sentry-plugin/src/sentry.service.ts index 307fc339d3..d90e7a4d97 100644 --- a/packages/sentry-plugin/src/sentry.service.ts +++ b/packages/sentry-plugin/src/sentry.service.ts @@ -26,8 +26,10 @@ export class SentryService implements OnApplicationBootstrap, OnApplicationShutd return Sentry.close(); } - captureException(exception: Error) { - Sentry.captureException(exception); + captureException(exception: Error,flag: any) { + if(flag=='true'){ + Sentry.captureException(exception); + } } captureMessage(message: string, captureContext?: CaptureContext) {