- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 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