lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb in google-cloud-compute-v1-1.7.0 vs lib/google/cloud/compute/v1/public_advertised_prefixes/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 PublicAdvertisedPrefix resource.
#
@@ -284,12 +287,15 @@
@public_advertised_prefixes_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 PublicAdvertisedPrefix in the specified project using the parameters that are 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
##
# Lists the PublicAdvertisedPrefixes for a project.
#
@@ -429,12 +438,15 @@
result = ::Gapic::Rest::PagedEnumerable.new @public_advertised_prefixes_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
##
# Patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules.
#
@@ -504,11 +516,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 PublicAdvertisedPrefixes REST API.
#