eventsource
eventsource copied to clipboard
Request error details hidden to client
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) ?
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?
I'm just bubbling up the error message with Event
, not creating an ErrorEvent
. Let me know if this is the wrong direction.