Mangopay / mangopay2-ruby-sdk

Ruby Gem for MANGOPAY
https://rubygems.org/gems/mangopay
MIT License
42 stars 38 forks source link

FilterParameters.response doesnt handle cases when the response is not valid json #155

Closed IevaGraz closed 4 years ago

IevaGraz commented 4 years ago

https://github.com/Mangopay/mangopay2-ruby-sdk/blob/664126191dc3822cdfe4fa3871e61e6e055413e9/lib/mangopay/filter_parameters.rb#L14

Sometimes during network issues a non json response body is returned e.g. '()'. In this case do_request_with_logging method fails, because it relies on FilterParameters.response to parse body to json for filtering.

SoloJr commented 4 years ago

https://github.com/Mangopay/mangopay2-ruby-sdk/pull/160

I am not a ruby dev. I see your point in the question, hope this fixes it

IevaGraz commented 4 years ago

@SoloJr the link you provided is not working

SoloJr commented 4 years ago

https://github.com/Mangopay/mangopay2-ruby-sdk/pull/160

did not work as it was merged