diff --git a/CHANGELOG.md b/CHANGELOG.md index 1eea88c2fc17..9ffcb6b31942 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ ## Unreleased +### Deprecated `@WithSentry` in `@sentry/nestjs` + +The `@WithSentry` decorator was deprecated. Use `@SentryExceptionCaptured` instead. This is a simple renaming and functionality stays identical. + - "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott ## 8.39.0 diff --git a/docs/migration/draft-v9-migration-guide.md b/docs/migration/draft-v9-migration-guide.md index 1c85f0a9fd2d..3a7c8cb2343c 100644 --- a/docs/migration/draft-v9-migration-guide.md +++ b/docs/migration/draft-v9-migration-guide.md @@ -14,6 +14,10 @@ - Deprecated `debugIntegration`. To log outgoing events, use [Hook Options](https://docs.sentry.io/platforms/javascript/configuration/options/#hooks) (`beforeSend`, `beforeSendTransaction`, ...). - Deprecated `sessionTimingIntegration`. To capture session durations alongside events, use [Context](https://docs.sentry.io/platforms/javascript/enriching-events/context/) (`Sentry.setContext()`). +## `@sentry/nestjs` + +- Deprecated `@WithSentry`. Use `@SentryExceptionCaptured` instead. + ## `@sentry/types` - Deprecated `Request` in favor of `RequestEventData`. diff --git a/packages/nestjs/src/decorators.ts b/packages/nestjs/src/decorators.ts index 60e1049b3fd2..0a23ab488a2f 100644 --- a/packages/nestjs/src/decorators.ts +++ b/packages/nestjs/src/decorators.ts @@ -83,5 +83,7 @@ export function SentryExceptionCaptured() { /** * 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 d99f491c1f6c..71ef90a51586 100644 --- a/packages/nestjs/src/index.ts +++ b/packages/nestjs/src/index.ts @@ -5,6 +5,7 @@ export { init } from './sdk'; export { SentryTraced, SentryCron, + // eslint-disable-next-line deprecation/deprecation WithSentry, SentryExceptionCaptured, } from './decorators';