Open rhec opened 5 years ago
@rhec thanks for the issue! Sorry it's taken a while to get back to you. The change you put in looks pretty good.
I'm having a hard to replicating the issue though. I'm guessing it has to do with the response that bamboo is giving you. Would you be able to paste in the response that you are getting back from bamboo?
@rhec we just updated the gem versions to httparty and json with bamboozled version 0.3.0. Can you see if that magically fixes your issue?
Description
The JSON response from the server is failing to parse, because bamboozled is passing a
HTTParty::Response
object toJSON.parse
. This will raise an exception:ArgumentError: strict_parse() expected a String or IO Object.
That exception is caught, and bamboozled attempts to parse the JSON as XML, which also fails and raises an exception. That exception is not caught.Expected behavior
The JSON from the server is parsed and returned.
How To Reproduce
Environment
Ruby 2.4.5
Dependencies: httparty (0.13.3) json (1.8.6)
Potential solution
Change
JSON.parse(response)
toJSON.parse(response.body)
in base.rb.