Skip to content

Commit b038536

Browse files
committed
Remove SentryGlobalGraphQLFilter
1 parent 422defc commit b038536

File tree

2 files changed

+2
-37
lines changed

2 files changed

+2
-37
lines changed

dev-packages/e2e-tests/test-applications/nestjs-graphql/src/app.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ApolloDriver } from '@nestjs/apollo';
22
import { Logger, Module } from '@nestjs/common';
33
import { APP_FILTER } from '@nestjs/core';
44
import { GraphQLModule } from '@nestjs/graphql';
5-
import { SentryGlobalGraphQLFilter, SentryModule } from '@sentry/nestjs/setup';
5+
import { SentryGlobalFilter, SentryModule } from '@sentry/nestjs/setup';
66
import { AppResolver } from './app.resolver';
77

88
@Module({
@@ -19,7 +19,7 @@ import { AppResolver } from './app.resolver';
1919
AppResolver,
2020
{
2121
provide: APP_FILTER,
22-
useClass: SentryGlobalGraphQLFilter,
22+
useClass: SentryGlobalFilter,
2323
},
2424
{
2525
provide: Logger,

packages/nestjs/src/setup.ts

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -115,41 +115,6 @@ class SentryGlobalFilter extends BaseExceptionFilter {
115115
Catch()(SentryGlobalFilter);
116116
export { SentryGlobalFilter };
117117

118-
/**
119-
* Global filter to handle exceptions in NestJS + GraphQL applications and report them to Sentry.
120-
*
121-
* @deprecated `SentryGlobalGraphQLFilter` is deprecated. Use the `SentryGlobalFilter` instead. The `SentryGlobalFilter` is a drop-in replacement.
122-
*/
123-
class SentryGlobalGraphQLFilter {
124-
private static readonly _logger = new Logger('ExceptionsHandler');
125-
public readonly __SENTRY_INTERNAL__: boolean;
126-
127-
public constructor() {
128-
this.__SENTRY_INTERNAL__ = true;
129-
}
130-
131-
/**
132-
* Catches exceptions and reports them to Sentry unless they are HttpExceptions.
133-
*/
134-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
135-
public catch(exception: unknown, host: ArgumentsHost): void {
136-
// neither report nor log HttpExceptions
137-
if (exception instanceof HttpException) {
138-
throw exception;
139-
}
140-
if (exception instanceof Error) {
141-
// eslint-disable-next-line deprecation/deprecation
142-
SentryGlobalGraphQLFilter._logger.error(exception.message, exception.stack);
143-
}
144-
captureException(exception);
145-
throw exception;
146-
}
147-
}
148-
// eslint-disable-next-line deprecation/deprecation
149-
Catch()(SentryGlobalGraphQLFilter);
150-
// eslint-disable-next-line deprecation/deprecation
151-
export { SentryGlobalGraphQLFilter };
152-
153118
/**
154119
* Global filter to handle exceptions and report them to Sentry.
155120
*

0 commit comments

Comments
 (0)