-
Notifications
You must be signed in to change notification settings - Fork 335
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Better error debugging for generation #710
Comments
Makes sense. Wouldn't be too hard to implement. |
Fix: ruby#710 Makes it easier to debug why a given tree of objects can't be dumped as JSON. Co-Authored-By: Étienne Barrié <etienne.barrie@gmail.com>
Thank you, it worked great. Should it emit the invalid object as part of |
The object may be huge, that's why it's included in |
TIL about https://docs.ruby-lang.org/en/master/Exception.html#method-i-detailed_message |
Fix: ruby/json#710 Makes it easier to debug why a given tree of objects can't be dumped as JSON. Co-Authored-By: Étienne Barrié <etienne.barrie@gmail.com>
Fix: ruby/json#710 Makes it easier to debug why a given tree of objects can't be dumped as JSON. Co-Authored-By: Étienne Barrié <etienne.barrie@gmail.com>
I'm trying to figure out why JSON is blowing up when generating the JSON for a big ole Hash of stuff. It raises a GeneratorError, but with no context so I can't easily tell where my bad data is. The line in question is here:
json/ext/json/ext/generator/generator.c
Line 912 in 55015fa
I would suggest this error include the relevant object at fault. Something like:
The text was updated successfully, but these errors were encountered: