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

What error conditions should be handled? #17

Open
huntc opened this issue Feb 14, 2024 · 3 comments
Open

What error conditions should be handled? #17

huntc opened this issue Feb 14, 2024 · 3 comments

Comments

@huntc
Copy link

huntc commented Feb 14, 2024

Thanks for providing this project.

I'm curious as to what causes an error to occur when consuming the event source stream and what must therefore should be handled by the application. I've found that browsers handle some errors and retry, but if you get a bad gateway response then the event source errors with them. Is there similar behaviour here?

@huntc
Copy link
Author

huntc commented Feb 14, 2024

A quick experiment yielded the following having terminated the server end:

request or response body error: error reading a body from connection: unexpected EOF during chunk size line

My expectation is that this library would retry given the default retry policy.

@huntc
Copy link
Author

huntc commented Feb 14, 2024

It has become clear to me now that one does not es.close() given a streaming error. Instead, the event source will retry. I think the example would benefit from avoiding the closing of the event source given the inherent and familiar behaviour of retries.

@huntc
Copy link
Author

huntc commented Feb 14, 2024

Happy to provide a PR on the example if there is agreement.

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

1 participant