Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setError() and sendError() don't work from inside error handler in Fastify #1150

Open
luismiramirez opened this issue Nov 21, 2024 · 1 comment
Assignees
Labels

Comments

@luismiramirez
Copy link
Member

The error-handling helpers from our library don't behave as expected when used inside Fastify error handler middleware.

Calling the OpenTelemetry API directly works. Using recordException() on the active span.

Internal link

@luismiramirez luismiramirez self-assigned this Nov 21, 2024
@luismiramirez
Copy link
Member Author

I couldn't reproduce using setErrorHandler() in Fastify 4 and 5. Both helpers setError() and sendError() work just fine. However, as the customer reported, they stop working when you set up a preHandler().

Here's a related issue from OpenTelemetry's official plugin, which is exactly the problem the customer is having. -> open-telemetry/opentelemetry-js-contrib#2355

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant