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

Error thrown from runHttpQuery results in "Headers have already sent." warning from moleculer-web #109

Open
kthompson23 opened this issue May 13, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@kthompson23
Copy link
Contributor

kthompson23 commented May 13, 2022

When the catch handler in moleculerApollo.js runs as a result of runHttpQuery throwing an error, it sets the status code on the response and calls end. Later in moleculer-web when we hit the sendResponse method, it logs a warning message "Headers have already sent." because response headers were already sent by moleculer-apollo.

This isn't causing any issue other than additional noise in the logs.

Instead of calling res.end in moleculerApollo.js, if the error message and status code was returned it could be passed to service.sendResponse and the error would be handled by moleculer-web.

@icebob icebob added the enhancement New feature or request label May 25, 2022
@icebob
Copy link
Member

icebob commented May 25, 2022

Could you help about it with a PR?

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

No branches or pull requests

2 participants