- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
def parse_response(object)
return Hashie::Mash.new(JSON.parse(object))
rescue => e
#should handle here different error types/levels or else throw the exceptions to the upper layer (client)
if e.is_a?(JSON::ParserError) && e.message =~ /<html>/
raise "Invalid response from Platform server - #{self.class.parse_json_error(response.body)}"
else
raise e
end
end
Комментарии (4) RSS
Добавить комментарий