diff --git a/lib/googleauth/compute_engine.rb b/lib/googleauth/compute_engine.rb index 119a04e..0603110 100644 --- a/lib/googleauth/compute_engine.rb +++ b/lib/googleauth/compute_engine.rb @@ -98,7 +98,8 @@ END when 404 raise(Signet::AuthorizationError, NO_METADATA_SERVER_ERROR) else - msg = "Unexpected error code #{resp.status}" + UNEXPECTED_ERROR_SUFFIX + msg = "Unexpected error code #{resp.status}" \ + "#{UNEXPECTED_ERROR_SUFFIX}" raise(Signet::AuthorizationError, msg) end end diff --git a/lib/googleauth/signet.rb b/lib/googleauth/signet.rb index 4f17107..02927aa 100644 --- a/lib/googleauth/signet.rb +++ b/lib/googleauth/signet.rb @@ -84,7 +84,9 @@ module Signet begin yield rescue => e - raise e if e.is_a?(Signet::AuthorizationError) || e.is_a?(Signet::ParseError) + if e.is_a?(Signet::AuthorizationError) || e.is_a?(Signet::ParseError) + raise e + end if retry_count < max_retry_count retry_count += 1