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

Json stream API: how to recover from an error? #331

Open
bergtwvd opened this issue Oct 26, 2021 · 1 comment
Open

Json stream API: how to recover from an error? #331

bergtwvd opened this issue Oct 26, 2021 · 1 comment

Comments

@bergtwvd
Copy link

bergtwvd commented Oct 26, 2021

When there is an error in the application streaming JSON objects via the Json Generator, the only option I currently have is to close the stream and restart. I believe the JSON-P API currently does not provide the possibility to discard the last object (that was partly written) and continue with the stream. What's the best approach? Or should the streaming API be extended to handle error recovery?

--Tom

@bergtwvd
Copy link
Author

What seems feasible is to have the ability to undo the addition of a JsonValue to a stream, when the stream has not been flushed yet. I.e. if there is an error in adding a value, the addition can be undone.

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