Skip to content
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

feat(nestjs)!: Remove @WithSentry decorator #14762

Merged
merged 4 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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 docs/migration/v8-to-v9.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ It will be removed in a future major version.

- The `getNumberOfUrlSegments` method has been removed. There are no replacements.

### `@sentry/nestjs`

- The `WithSentry` decorator has been removed. Use `SentryExceptionCaptured` instead.

## 5. Build Changes

Previously the CJS versions of the SDK code (wrongfully) contained compatibility statements for default exports in ESM:
Expand Down
2 changes: 1 addition & 1 deletion packages/nestjs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
7 changes: 0 additions & 7 deletions packages/nestjs/src/decorators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
10 changes: 2 additions & 8 deletions packages/nestjs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Loading