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
In this code for the setupNestErrorHandler, an interceptor is created. It wants to get an HTTP request from the execution context and when the request has a route property it uses that to set the transaction name:
However, this assumes the NestJS app is only operating as an HTTP server. NestJS execution contexts come in different varieties when the app is being used for microservices or as a GraphQL server. These contexts may not have a request, and this is not respected by the handler.
Expected Result
The interceptor should check if it is in an HTTP execution context before inspecting the request or route.
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/node
SDK Version
8.0.0-beta.6
Framework Version
No response
Link to Sentry event
No response
SDK Setup
No response
Steps to Reproduce
In this code for the
setupNestErrorHandler
, an interceptor is created. It wants to get an HTTP request from the execution context and when the request has a route property it uses that to set the transaction name:sentry-javascript/packages/node/src/integrations/tracing/nest.ts
Lines 52 to 66 in 3355a05
However, this assumes the NestJS app is only operating as an HTTP server. NestJS execution contexts come in different varieties when the app is being used for microservices or as a GraphQL server. These contexts may not have a request, and this is not respected by the handler.
Expected Result
The interceptor should check if it is in an HTTP execution context before inspecting the request or route.
Actual Result
In non-HTTP contexts, an error occurs in the interceptor:
See #5578 (comment)
The text was updated successfully, but these errors were encountered: