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

- old
+ new

@@ -230,12 +230,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 Snapshot resource. Gets a list of available snapshots by making a list() request. # @@ -293,12 +296,15 @@ @snapshots_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. # @@ -358,12 +364,15 @@ @snapshots_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 a snapshot in the specified project using the data included in the request. For regular snapshot creation, consider using this method instead of disks.createSnapshot, as this method supports more features, such as creating snapshots in a project different from the source disk project. # @@ -431,12 +440,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 Snapshot resources contained within the specified project. # @@ -503,12 +515,15 @@ result = ::Gapic::Rest::PagedEnumerable.new @snapshots_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. # @@ -568,12 +583,15 @@ @snapshots_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 ## # Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation. # @@ -641,12 +659,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 permissions that a caller has on the specified resource. # @@ -706,11 +727,14 @@ @snapshots_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 Snapshots REST API. #