lib/google/cloud/compute/v1/target_instances/rest/client.rb in google-cloud-compute-v1-1.7.0 vs lib/google/cloud/compute/v1/target_instances/rest/client.rb in google-cloud-compute-v1-1.7.1

- old
+ new

@@ -225,12 +225,15 @@ result = ::Gapic::Rest::PagedEnumerable.new @target_instances_stub, :aggregated_list, "items", request, result, options yield result, response if block_given? return result end rescue ::Faraday::Error => e - gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e - raise ::Google::Cloud::Error.from_error(gapic_error) + begin + raise ::Gapic::Rest::Error.wrap_faraday_error e + rescue ::Gapic::Rest::Error => gapic_error + raise ::Google::Cloud::Error.from_error gapic_error + end end ## # Deletes the specified TargetInstance resource. # @@ -301,12 +304,15 @@ ) yield result, response if block_given? return result end rescue ::Faraday::Error => e - gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e - raise ::Google::Cloud::Error.from_error(gapic_error) + begin + raise ::Gapic::Rest::Error.wrap_faraday_error e + rescue ::Gapic::Rest::Error => gapic_error + raise ::Google::Cloud::Error.from_error gapic_error + end end ## # Returns the specified TargetInstance resource. Gets a list of available target instances by making a list() request. # @@ -366,12 +372,15 @@ @target_instances_stub.get request, options do |result, response| yield result, response if block_given? return result end rescue ::Faraday::Error => e - gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e - raise ::Google::Cloud::Error.from_error(gapic_error) + begin + raise ::Gapic::Rest::Error.wrap_faraday_error e + rescue ::Gapic::Rest::Error => gapic_error + raise ::Google::Cloud::Error.from_error gapic_error + end end ## # Creates a TargetInstance resource in the specified project and zone using the data included in the request. # @@ -442,12 +451,15 @@ ) yield result, response if block_given? return result end rescue ::Faraday::Error => e - gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e - raise ::Google::Cloud::Error.from_error(gapic_error) + begin + raise ::Gapic::Rest::Error.wrap_faraday_error e + rescue ::Gapic::Rest::Error => gapic_error + raise ::Google::Cloud::Error.from_error gapic_error + end end ## # Retrieves a list of TargetInstance resources available to the specified project and zone. # @@ -516,11 +528,14 @@ result = ::Gapic::Rest::PagedEnumerable.new @target_instances_stub, :list, "items", request, result, options yield result, response if block_given? return result end rescue ::Faraday::Error => e - gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e - raise ::Google::Cloud::Error.from_error(gapic_error) + begin + raise ::Gapic::Rest::Error.wrap_faraday_error e + rescue ::Gapic::Rest::Error => gapic_error + raise ::Google::Cloud::Error.from_error gapic_error + end end ## # Configuration class for the TargetInstances REST API. #