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.Unmarshal errors not catch in method client.Write #1662
Conversation
Makes sense to me.
|
tests got 'unexpected end of JSON input' error, but you use Unmarshal instead Marshal... just make changes:
and tests done |
@corylanou -- can we merge this? Looks like the code was using the wrong function. |
We should open an issue to write a test around it, but other than that, looks good. |
So #1680 is a test that covers this issue. However also highlights the issue that the write() actually wraps the write{} in an array (not sure why) which isn't how it's expected at the server end. |
@d2g The write endpoint can take a single write, or multiple writes. This allows the end user to open an http endpoint and stream multiple writes without having to close the connection. This can cut down on the overhead of connecting/disconnecting, as that overhead is typically higher than the actual payload being sent. |
We should add test coverage for multiple writes at some point as well. Looking at the test coverage, that case it not covered. We also don't cover it in the documentation. I'll open up 2 issues prior to closing this issue as a reminder to update both test coverage and documentation. |
Fixed in #1868 |
No description provided.