From 227ba09a7ee993fdfb9c891603305963fee56d3c Mon Sep 17 00:00:00 2001 From: Kazuhiro Serizawa Date: Fri, 14 Jul 2017 08:04:35 +0900 Subject: [PATCH] Fix rubocop cautions --- lib/googleauth/compute_engine.rb | 3 ++- lib/googleauth/signet.rb | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) 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