rubygarage / api_struct

API wrapper builder with response serialization
MIT License
234 stars 21 forks source link

returns error body if it is impossible to parse JSON #6

Closed sigra closed 5 years ago

sigra commented 5 years ago

Hi. I'm writing wrapper for YandexKassa API and realized that sometimes I get JSON::ParserError for failed requests. It happens because API responds with HTML page. So, in this case it is impossible to parse JSON from HTML and I guess it would be nice if we just use raw response body.

kirillshevch commented 5 years ago

Thank you, we are also faced with this problem. I'll release fix in 1.0.1