Open jablan opened 1 year ago
At least some timeout errors do not have valid JSON, and although their body contains the reason they end up here https://github.com/chargebee/chargebee-ruby/blob/master/lib/chargebee/rest.rb#L82 resulting with a generic error. Also, rest.rb has JSON parsing on two places, which should be unified.
rest.rb
A/C: Properly handle timeout errors and eventually use this code for them: https://github.com/chargebee/chargebee-ruby/blob/master/lib/chargebee/rest.rb#L65
Bonus points: create different exception types for different failure reasons.
At least some timeout errors do not have valid JSON, and although their body contains the reason they end up here https://github.com/chargebee/chargebee-ruby/blob/master/lib/chargebee/rest.rb#L82 resulting with a generic error. Also,
rest.rb
has JSON parsing on two places, which should be unified.A/C: Properly handle timeout errors and eventually use this code for them: https://github.com/chargebee/chargebee-ruby/blob/master/lib/chargebee/rest.rb#L65
Bonus points: create different exception types for different failure reasons.