The docs does not specify which error you got if it fails to parse the document https://ruby-doc.org/stdlib-2.7.1/libdoc/json/rdoc/JSON.html#method-i-parse