Skip to content

Commit

Permalink
fix(nestjs): Ensure exception and host are correctly passed on when u…
Browse files Browse the repository at this point in the history
…sing @WithSentry (#13564)

Also adds the `nestjs-with-submodules-decorator` e2e test app to be run
on CI.
  • Loading branch information
andreiborza committed Sep 3, 2024
1 parent c9c346c commit 9b8f9ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,7 @@ jobs:
'nestjs-basic',
'nestjs-distributed-tracing',
'nestjs-with-submodules',
'nestjs-with-submodules-decorator',
'nestjs-graphql',
'node-exports-test-app',
'node-koa',
Expand Down
4 changes: 2 additions & 2 deletions packages/nestjs/src/decorators/with-sentry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ export function WithSentry() {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
descriptor.value = function (exception: unknown, host: unknown, ...args: any[]) {
if (isExpectedError(exception)) {
return originalCatch.apply(this, args);
return originalCatch.apply(this, [exception, host, ...args]);
}

captureException(exception);
return originalCatch.apply(this, args);
return originalCatch.apply(this, [exception, host, ...args]);
};

return descriptor;
Expand Down

0 comments on commit 9b8f9ea

Please sign in to comment.