lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb in google-cloud-compute-v1-1.7.0 vs lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb in google-cloud-compute-v1-1.7.1
- old
+ new
@@ -233,12 +233,15 @@
result = ::Gapic::Rest::PagedEnumerable.new @network_endpoint_groups_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
##
# Attach a list of network endpoints to the specified network endpoint group.
#
@@ -311,12 +314,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
##
# Deletes the specified network endpoint group. The network endpoints in the NEG and the VM instances they belong to are not terminated when the NEG is deleted. Note that the NEG cannot be deleted if there are backend services referencing it.
#
@@ -387,12 +393,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
##
# Detach a list of network endpoints from the specified network endpoint group.
#
@@ -465,12 +474,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 network endpoint group. Gets a list of available network endpoint groups by making a list() request.
#
@@ -530,12 +542,15 @@
@network_endpoint_groups_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 network endpoint group in the specified project using the parameters that are included in the request.
#
@@ -606,12 +621,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 the list of network endpoint groups that are located in the specified project and zone.
#
@@ -680,12 +698,15 @@
result = ::Gapic::Rest::PagedEnumerable.new @network_endpoint_groups_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
##
# Lists the network endpoints in the specified network endpoint group.
#
@@ -758,12 +779,15 @@
result = ::Gapic::Rest::PagedEnumerable.new @network_endpoint_groups_stub, :list_network_endpoints, "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
##
# Returns permissions that a caller has on the specified resource.
#
@@ -825,11 +849,14 @@
@network_endpoint_groups_stub.test_iam_permissions 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
##
# Configuration class for the NetworkEndpointGroups REST API.
#