From 9e7b949b5dcab16d9ccd487850a6968c6e66f248 Mon Sep 17 00:00:00 2001 From: Charly Gomez Date: Wed, 18 Dec 2024 11:47:46 +0100 Subject: [PATCH] feat(nestjs)!: Remove `@WithSentry` decorator (#14762) --- docs/migration/v8-to-v9.md | 1 + packages/nestjs/README.md | 2 +- packages/nestjs/src/decorators.ts | 7 ------- packages/nestjs/src/index.ts | 10 ++-------- 4 files changed, 4 insertions(+), 16 deletions(-) diff --git a/docs/migration/v8-to-v9.md b/docs/migration/v8-to-v9.md index 3854a5b44ae3..2c297762c967 100644 --- a/docs/migration/v8-to-v9.md +++ b/docs/migration/v8-to-v9.md @@ -108,6 +108,7 @@ It will be removed in a future major version. ### `@sentry/nestjs` +- Removed `WithSentry` decorator. Use `SentryExceptionCaptured` instead. - Removed `SentryService`. If you are using `@sentry/nestjs` you can safely remove any references to the `SentryService`. If you are using another package migrate to `@sentry/nestjs` and remove the `SentryService` afterwards. diff --git a/packages/nestjs/README.md b/packages/nestjs/README.md index 1a3ae775b7fd..ae2c35c4c2ab 100644 --- a/packages/nestjs/README.md +++ b/packages/nestjs/README.md @@ -74,7 +74,7 @@ decorator will report all unexpected errors that are received by your global err ```typescript import { Catch, ExceptionFilter } from '@nestjs/common'; -import { WithSentry } from '@sentry/nestjs'; +import { SentryExceptionCaptured } from '@sentry/nestjs'; @Catch() export class YourCatchAllExceptionFilter implements ExceptionFilter { diff --git a/packages/nestjs/src/decorators.ts b/packages/nestjs/src/decorators.ts index 89e82588cd7a..42592e62d553 100644 --- a/packages/nestjs/src/decorators.ts +++ b/packages/nestjs/src/decorators.ts @@ -74,10 +74,3 @@ export function SentryExceptionCaptured() { return descriptor; }; } - -/** - * A decorator to wrap user-defined exception filters and add Sentry error reporting. - * - * @deprecated This decorator was renamed and will be removed in a future major version. Use `SentryExceptionCaptured` instead. - */ -export const WithSentry = SentryExceptionCaptured; diff --git a/packages/nestjs/src/index.ts b/packages/nestjs/src/index.ts index dc8815477910..f22ce71ea89d 100644 --- a/packages/nestjs/src/index.ts +++ b/packages/nestjs/src/index.ts @@ -2,12 +2,6 @@ export * from '@sentry/node'; export { nestIntegration } from './integrations/nest'; -export { init, getDefaultIntegrations } from './sdk'; +export { getDefaultIntegrations, init } from './sdk'; -export { - SentryTraced, - SentryCron, - // eslint-disable-next-line deprecation/deprecation - WithSentry, - SentryExceptionCaptured, -} from './decorators'; +export { SentryCron, SentryExceptionCaptured, SentryTraced } from './decorators';