Skip to content

Commit

Permalink
chore(nestjs): extend global filter for simplicity
Browse files Browse the repository at this point in the history
  • Loading branch information
Sjoertjuh committed Sep 20, 2024
1 parent 82de516 commit 73a1b3b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/nestjs/src/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,13 @@ export { SentryGlobalGraphQLFilter };
*
* This filter is a generic filter that can handle both HTTP and GraphQL exceptions.
*/
class SentryGlobalGenericFilter {
class SentryGlobalGenericFilter extends SentryGlobalFilter {
public readonly __SENTRY_INTERNAL__: boolean;
private readonly _globalFilter : SentryGlobalFilter;
private readonly _graphqlFilter: SentryGlobalGraphQLFilter;

public constructor(applicationRef?: HttpServer) {
super(applicationRef);
this.__SENTRY_INTERNAL__ = true;
this._globalFilter = new SentryGlobalFilter(applicationRef);
this._graphqlFilter = new SentryGlobalGraphQLFilter();
}

Expand All @@ -148,7 +147,7 @@ class SentryGlobalGenericFilter {
return this._graphqlFilter.catch(exception, host);
}

this._globalFilter .catch(exception, host);
super.catch(exception, host);
}
}
Catch()(SentryGlobalGenericFilter);
Expand Down

0 comments on commit 73a1b3b

Please sign in to comment.