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

Request error details hidden to client #91

Closed
fabricemathis opened this issue Dec 21, 2017 · 3 comments
Closed

Request error details hidden to client #91

fabricemathis opened this issue Dec 21, 2017 · 3 comments

Comments

@fabricemathis
Copy link

Say we have an eventsource client connected to a server and receiving messages.

Il the server goes down, the onerror callback is invoked, which is fine, but the event that is passed only contains { type: 'error' }

Could it be possible to add more info to the event, like the original error code ('ECONNREFUSED' for instance) ?

@aslakhellesoy
Copy link
Contributor

The library currently emits Event for all events, but it should be possible to emit ErrorEvent instead, which can have an error property.

Do you want to have a go at implementing this?

@RasPhilCo
Copy link
Contributor

I'm just bubbling up the error message with Event, not creating an ErrorEvent. Let me know if this is the wrong direction.

@rexxars
Copy link
Member

rexxars commented Dec 7, 2024

eventsource@^3 exposes (ever so slightly) more information on errors.

@rexxars rexxars closed this as completed Dec 7, 2024
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