Add Signet::UnexpectedStatusError (#711)

This commit is contained in:
Yoann Lecuyer 2018-09-24 20:46:31 +02:00 committed by Graham Paye
parent d120e03acc
commit 224497c4a3
2 changed files with 2 additions and 2 deletions

View File

@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
spec.add_runtime_dependency 'retriable', '>= 2.0', '< 4.0' spec.add_runtime_dependency 'retriable', '>= 2.0', '< 4.0'
spec.add_runtime_dependency 'addressable', '~> 2.5', '>= 2.5.1' spec.add_runtime_dependency 'addressable', '~> 2.5', '>= 2.5.1'
spec.add_runtime_dependency 'mime-types', '~> 3.0' spec.add_runtime_dependency 'mime-types', '~> 3.0'
spec.add_runtime_dependency 'signet', '~> 0.9' spec.add_runtime_dependency 'signet', '~> 0.10'
spec.add_runtime_dependency 'googleauth', '>= 0.5', '< 0.7.0' spec.add_runtime_dependency 'googleauth', '>= 0.5', '< 0.7.0'
spec.add_runtime_dependency 'httpclient', '>= 2.8.1', '< 3.0' spec.add_runtime_dependency 'httpclient', '>= 2.8.1', '< 3.0'
spec.add_development_dependency 'thor', '~> 0.19' spec.add_development_dependency 'thor', '~> 0.19'

View File

@ -99,7 +99,7 @@ module Google
# NotFound, etc # NotFound, etc
auth_tries = (try == 1 && authorization_refreshable? ? 2 : 1) auth_tries = (try == 1 && authorization_refreshable? ? 2 : 1)
Retriable.retriable tries: auth_tries, Retriable.retriable tries: auth_tries,
on: [Google::Apis::AuthorizationError, Signet::AuthorizationError, Signet::RemoteServerError], on: [Google::Apis::AuthorizationError, Signet::AuthorizationError, Signet::RemoteServerError, Signet::UnexpectedStatusError],
on_retry: proc { |*| refresh_authorization } do on_retry: proc { |*| refresh_authorization } do
execute_once(client).tap do |result| execute_once(client).tap do |result|
if block_given? if block_given?