[GODRIVER-1166] The extJSONValueReader should honor the error of its underlying reader Created: 27/Jun/19  Updated: 08/Jan/24

Status: Backlog
Project: Go Driver
Component/s: JSON & ExtJSON
Affects Version/s: None
Fix Version/s: 2.0.0

Type: Bug Priority: Major - P3
Reporter: May Hoque Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: jeff+
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Epic Link: Go Driver 2.0 BSON
Quarter: FY24Q3
Backwards Compatibility: Major Change

 Description   

Currently, the extJSONValueReader will not honor the error returned by its underlying reader, and instead, will return ErrInvalidJSON. This is probably not correct, since the underlying reader could easily error out for a reason that does not have to do with invalid JSON, and in either case, this removes vital information about why there was an error.

I believe this code should return the error from the underlying reader, err, instead of ErrInvalidJSON.

This ticket was created from this slack thread.



 Comments   
Comment by May Hoque [ 13/Apr/22 ]

Yes, it makes it so that some classes of error are impossible for us to see in our logs for example, or expose to end-users because the reader is effectively hiding them from us.

In general, this is a bug that affects every user of the code... people will be told their JSON is invalid even though it is not.

Generated at Thu Feb 08 08:35:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.