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
By the point its throwing it (correct me if i'm wrong), we've already parsed some of the data.
It would be useful to know:
What object was failed to parse? what was its type, and where it began? (in the example: the location of the [ before the 8, and then the first [)
What are the objects that have been parsed so far? (in the example: [1,2,3,4,5], [3,4,5,6,7], and 8)
The scenario I'm looking for is implementing streaming-like parsing for a very specific case, and I know streaming isn't planned (#27), so I'm trying to find other small features that might be possible and will help me.
In this case, resuming to parse after more data arrives, without re-parsing everything.
The text was updated successfully, but these errors were encountered:
We can definitely add more context to the truncated error message to help with debugging. We won't ever provide a way to access half-parsed messages though.
If possible, can you open a new issue with your exact real problem? It's easier for me as a maintainer to suggest solutions to the actual issue you're dealing with, not workaround ideas you've come up with.
jcrist
changed the title
Input Truncated Error - getting parsed so far, or some option to resume parsing with more data
Improve "Input data was truncated" error message
Aug 2, 2022
Consider:
msgspec.json.decode(b"[[1,2,3,4,5], [3,4,5,6,7], [8,")
Will throw:
DecodeError: Input data was truncated
Which is pretty lacking in information.
By the point its throwing it (correct me if i'm wrong), we've already parsed some of the data.
It would be useful to know:
[
before the 8, and then the first[
)[1,2,3,4,5], [3,4,5,6,7]
, and8
)The scenario I'm looking for is implementing streaming-like parsing for a very specific case, and I know streaming isn't planned (#27), so I'm trying to find other small features that might be possible and will help me.
In this case, resuming to parse after more data arrives, without re-parsing everything.
The text was updated successfully, but these errors were encountered: