Skip to content

Commit

Permalink
feat(nestjs)!: Remove @WithSentry decorator (#14762)
Browse files Browse the repository at this point in the history
  • Loading branch information
chargome authored Dec 18, 2024
1 parent ba0ec1e commit 9e7b949
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 16 deletions.
1 change: 1 addition & 0 deletions docs/migration/v8-to-v9.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
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';

0 comments on commit 9e7b949

Please sign in to comment.