EventSource
EventSource copied to clipboard
Error status propagation
- If the server is down the preflight generated a ERR_CONNECTION_REFUSED can you please propagate it? so that we can handle it on the app level?
- Can you please add the status code inside the error event? currently i have to catch the zone error and check if the message contains 401 ou other code. It can we easier if you propagate the error code.
Thank you
Hi, I just create a branch with a fix. Could you try it ? Error are now propagated on onerror listener with the status code
Thank you. I ll be testing it tonight and giving you a feedback on it.
If your feedback is positive, i will relesea a new version
So for the HTTP.status code it is being propagated. All is good. There is still one case where the server is unavailable the OPTIONS (preflight) gives a net::ERR_CONNECTION_REFUSED.
If you can catch this with a try catch around the xhr and propagate it as a 503.
There are more error responses cases that as much less common but you can just add the message of the error in the error event.
https://stackoverflow.com/questions/28556398/how-to-catch-neterr-connection-refused
Any news on the next release? I would like to integrated before my next release myself ;) Thank you again
new release done, but COONECTION_REFUSED is not inside.
Noted. If you have the time for the other feature it would be awesome. Thank you again for you reactivity.