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
Currently one has to maintain a copy of the data being decoded by json.Decoder to retrieve the underlying data yielding an UnmarshalTypeError when decoding a json stream.
Making the data in decodeState.data directly accessible in the returned error:
typeUnmarshalTypeErrorstruct {
…
Data []byte
}
would make it easy to enable improved diagnostics for faulty inputs.
(Somewhat related to #8254 and #9693 which are also about error diagnostics in encoding/json.)
The text was updated successfully, but these errors were encountered:
bradfitz
changed the title
encoding/json: add access to the underlying data causing UnmarshalTypeError
proposal: encoding/json: add access to the underlying data causing UnmarshalTypeError
Nov 15, 2017
Currently one has to maintain a copy of the data being decoded by
json
.Decoder
to retrieve the underlying data yielding anUnmarshalTypeError
when decoding ajson
stream.Making the data in
decodeState
.data
directly accessible in the returned error:would make it easy to enable improved diagnostics for faulty inputs.
(Somewhat related to #8254 and #9693 which are also about error diagnostics in
encoding/json
.)The text was updated successfully, but these errors were encountered: