Skip to content

feat(nestjs): Deprecate @WithSentry in favor of @SentryExceptionCaptured #14323

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions docs/migration/draft-v9-migration-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
2 changes: 2 additions & 0 deletions packages/nestjs/src/decorators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
1 change: 1 addition & 0 deletions packages/nestjs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export { init } from './sdk';
export {
SentryTraced,
SentryCron,
// eslint-disable-next-line deprecation/deprecation
WithSentry,
SentryExceptionCaptured,
} from './decorators';
Loading