You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've hit a bug in a production scenario in which an upstream provider supplies a truncated JSON stream. The connection drops, and we have no way to know that we have partial data, and no way to request the data again. Since this is fairly normal (the expectation being that it will be called again with a continuation from where it left off) and not a failure scenario, the ability to make it a failure scenario would be very helpful.
The following is the rough API I would envision:
p=Yajl::Parser.new# => #<Yajl::Parser:0x007fa60bae56d8>p.parse(truncated_json)# => nilp.closed?# => falsep.close# ! raised ParseError: buffer remaining.# If possible, include buffer or state representation in exception messagep.closed?# => truep.parse(remainder)# ! raised ParseError: buffer closed.
This will help with issues like #123, #58, and expectations set for JSON-gem compatibility (even though you plan to drop it in 2.x)
If you have strong opinions for or against, I would appreciate them before I begin the work.
The text was updated successfully, but these errors were encountered:
I've hit a bug in a production scenario in which an upstream provider supplies a truncated JSON stream. The connection drops, and we have no way to know that we have partial data, and no way to request the data again. Since this is fairly normal (the expectation being that it will be called again with a continuation from where it left off) and not a failure scenario, the ability to make it a failure scenario would be very helpful.
The following is the rough API I would envision:
This will help with issues like #123, #58, and expectations set for JSON-gem compatibility (even though you plan to drop it in 2.x)
If you have strong opinions for or against, I would appreciate them before I begin the work.
The text was updated successfully, but these errors were encountered: