lib/geo_certs/exceptions.rb in geocerts-0.0.20 vs lib/geo_certs/exceptions.rb in geocerts-0.0.21

- old
+ new

@@ -68,15 +68,18 @@ end def response=(response) # :nodoc: @response = response - if !response.respond_to?(:body) - return @response - elsif Hash.respond_to?(:from_xml) - build_objects_for(Hash.from_xml(decode(response['content-encoding'], response.body))) - else - build_objects_for(parse_errors(decode(response['content-encoding'], response.body))) + begin + if !response.respond_to?(:body) + return @response + elsif Hash.respond_to?(:from_xml) + build_objects_for(Hash.from_xml(decode(response['content-encoding'], response.body))) + else + build_objects_for(parse_errors(decode(response['content-encoding'], response.body))) + end + rescue end @response end