8000 Error not propagated for unexpected response · Issue #4 · rexxars/eventsource-client · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Error not propagated for unexpected response #4

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

Open
Tomas2D opened this issue Oct 15, 2024 · 5 comments
Open

Error not propagated for unexpected response #4

Tomas2D opened this issue Oct 15, 2024 · 5 comments

Comments

@Tomas2D
Copy link
Tomas2D commented Oct 15, 2024

The library does not throw an error when the target server sends a JSON response instead of SSE.
It silently fails, and the node process exits with status code 13.

@Tomas2D Tomas2D changed the title Error on connection Error not propagated for unexpected response Oct 15, 2024
@Tomas2D
Copy link
Author
Tomas2D commented Nov 12, 2024

ping @rexxars

@rexxars
Copy link
Owner
rexxars commented Nov 14, 2024

What is the ideal way you'd want to surface/handle errors like this?

8000
@Tomas2D
Copy link
Author
Tomas2D commented Nov 22, 2024

I would either throw the error right away and let the user handle it or add a special callback like onError so that the user
can handle it or throw their own error instead.

Another approach would be to propagate such information to onMessage. See our use-case.

https://github.com/i-am-bee/bee-agent-framework/blob/main/src/internals/fetcher.ts#L74-L103

@monokizsolt
Copy link

+1

@punkpeye
Copy link

Has anyone found a way to handle this? Is patching the source code the only way now?

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

No branches or pull requests

4 participants
0