-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: lc 604 sentry integration (#420)
* feat: sentry integration * chore: change interceptor types * chore: remove unnecessary import * fix: build fix * chore: add blank values to env.example
- Loading branch information
1 parent
287b1de
commit 7f00760
Showing
6 changed files
with
779 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Injectable } from "@nestjs/common"; | ||
import * as Sentry from "@sentry/node"; | ||
import { catchError, throwError } from "rxjs"; | ||
|
||
import type { CallHandler, ExecutionContext, NestInterceptor } from "@nestjs/common"; | ||
import type { Observable } from "rxjs"; | ||
|
||
@Injectable() | ||
export class SentryInterceptor<T> implements NestInterceptor<T> { | ||
intercept(context: ExecutionContext, next: CallHandler<T>): Observable<T> { | ||
return next.handle().pipe( | ||
catchError((error) => { | ||
Sentry.captureException(error); | ||
return throwError(() => error); | ||
}), | ||
); | ||
} | ||
} |
Oops, something went wrong.