Open dwalend opened 9 years ago
What about putting the JSON on one really long line (take the newlines out?) does that help?
It could be impossible to diagnose a problem without having the text (if the problem is in the truncated part).
How about putting the full JSON string in the Exception, as a member, instead of in the message? That wouldn't help with transmission, but would help with diagnosing problems and reduce clutter.
Bonus points if the parser can tell us "scala.pickling.PicklingException: failed to parse near 'as JSON' " message. (The JSONPickle's toString gives the default JSONPickle, and has an "as JSON" at the end. value has a version without the boilerplate.)
An aside -- it's pretty clear that the JSONPickle is JSON. No need to put the "as JSON" bits on the end.
BTW, echoing the input data (truncated or otherwise) in the exception message might be seen as a security weakness. See http://cwe.mitre.org/data/definitions/209.html
The full text of the pickled string is scrolling by when something goes wrong. (Will figure out what in a bit.) It's scrolling passed the limits of my shell buffer. This could also cause trouble in logs or if the exception message has to be transmitted.
Is there a good way to truncate the error message?
Thanks,
Dave