You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/platforms/javascript/guides/nestjs/index.mdx
+1-84Lines changed: 1 addition & 84 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,90 +41,7 @@ To import and initialize Sentry, create a file named `instrument.ts` in the root
41
41
42
42
## Step 3: Capture Nest.js Errors
43
43
44
-
By default, Sentry only captures unhandled exceptions that aren't caught by an error filter.
45
-
Additionally, `HttpException`s (including [derivatives](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)) aren't captured by default because they mostly act as control flow vehicles.
46
-
47
-
To make sure Sentry captures all your app's errors, configure error handling based on how your application manages exceptions:
48
-
49
-
### Using a Global Catch-All Exception Filter
50
-
51
-
If you have a global catch-all exception filter, add a `@SentryExceptionCaptured()` decorator to the filter's `catch()` method:
If you don't have a global catch-all exception filter, add the `SentryGlobalFilter` to the providers of your main module, **before** any other exception filters:
### Using Error Filters for Specific Exception Types
88
-
89
-
If you have error filters for specific types of exceptions (for example, `@Catch(HttpException)`) and you want to report these errors to Sentry, you need to capture them in the `catch()` handler using `Sentry.captureException()`:
If you're using `@nestjs/microservices` make sure to handle errors in RPC contexts correctly by providing your own `RpcExceptionFilter` (see [Nest.js Microservices documentation](https://docs.nestjs.com/microservices/exception-filters)).
108
-
`SentryGlobalFilter` in a [hybrid application](https://docs.nestjs.com/faq/hybrid-application) doesn't extend `BaseRpcExceptionFilter` since this depends on `@nestjs/microservices`.
109
-
110
-
Use `Sentry.captureException(exception)` in your custom filter in case you want to send these errors to Sentry:
By default, Sentry only captures unhandled exceptions that aren't caught by an error filter.
2
+
Additionally, `HttpException`s (including [derivatives](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)) aren't captured by default because they mostly act as control flow vehicles.
3
+
4
+
To make sure Sentry captures all your app's errors, configure error handling based on how your application manages exceptions:
5
+
6
+
### Using a Global Catch-All Exception Filter
7
+
8
+
If you have a global catch-all exception filter, add a `@SentryExceptionCaptured()` decorator to the filter's `catch()` method:
If you don't have a global catch-all exception filter, add the `SentryGlobalFilter` to the providers of your main module, **before** any other exception filters:
### Using Error Filters for Specific Exception Types
45
+
46
+
If you have error filters for specific types of exceptions (for example, `@Catch(HttpException)`) and you want to report these errors to Sentry, you need to capture them in the `catch()` handler using `Sentry.captureException()`:
If you're using `@nestjs/microservices` make sure to handle errors in RPC contexts correctly by providing your own `RpcExceptionFilter` (see [Nest.js Microservices documentation](https://docs.nestjs.com/microservices/exception-filters)).
65
+
`SentryGlobalFilter` in a [hybrid application](https://docs.nestjs.com/faq/hybrid-application) doesn't extend `BaseRpcExceptionFilter` since this depends on `@nestjs/microservices`.
66
+
67
+
Use `Sentry.captureException(exception)` in your custom filter in case you want to send these errors to Sentry:
0 commit comments