lib/google/cloud/compute/v1/instance_templates/rest/client.rb in google-cloud-compute-v1-1.7.0 vs lib/google/cloud/compute/v1/instance_templates/rest/client.rb in google-cloud-compute-v1-1.7.1
- old
+ new
@@ -228,12 +228,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 instance template. Gets a list of available instance templates by making a list() request.
#
@@ -291,12 +294,15 @@
@instance_templates_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
##
# Gets the access control policy for a resource. May be empty if no such policy or resource exists.
#
@@ -356,12 +362,15 @@
@instance_templates_stub.get_iam_policy 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 instance template in the specified project using the data that is included in the request. If you are creating a new template to update an existing instance group, your new instance template must use the same network or, if applicable, the same subnetwork as the original template.
#
@@ -429,12 +438,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 instance templates that are contained within the specified project.
#
@@ -501,12 +513,15 @@
result = ::Gapic::Rest::PagedEnumerable.new @instance_templates_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 access control policy on the specified resource. Replaces any existing policy.
#
@@ -566,12 +581,15 @@
@instance_templates_stub.set_iam_policy 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
##
# Returns permissions that a caller has on the specified resource.
#
@@ -631,11 +649,14 @@
@instance_templates_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 InstanceTemplates REST API.
#