lib/google/cloud/compute/v1/global_addresses/rest/client.rb in google-cloud-compute-v1-1.7.0 vs lib/google/cloud/compute/v1/global_addresses/rest/client.rb in google-cloud-compute-v1-1.7.1
- old
+ new
@@ -221,12 +221,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 address resource. Gets a list of available addresses by making a list() request.
#
@@ -284,12 +287,15 @@
@global_addresses_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 an address resource in the specified project by using the data included in the request.
#
@@ -357,12 +363,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 global addresses.
#
@@ -429,12 +438,15 @@
result = ::Gapic::Rest::PagedEnumerable.new @global_addresses_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
##
# Sets the labels on a GlobalAddress. To learn more about labels, read the Labeling Resources documentation.
#
@@ -502,11 +514,14 @@
)
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 GlobalAddresses REST API.
#