Skip to content

Commit

Permalink
Improve token refresh error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
pacive committed Jan 13, 2019
1 parent 349e165 commit 336cc31
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/simpleoauth.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# puts oauth.post('/resource', { data: 'some_data' }.to_json, 'content-type' => 'application/json')
module SimpleOAuth
# Version of the gem
VERSION = '0.5.0'
VERSION = '0.5.1'

class OAuthError < StandardError
end
Expand Down
4 changes: 3 additions & 1 deletion lib/simpleoauth/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ def refresh_token

save_token
rescue StandardError => e
puts "Unable to refresh token\n#{e.message}"
puts "Unable to refresh token\n#{e.message}\n#{e.backtrace}"
puts 'Reloading saved token'
load_token
end

# Process request
Expand Down

0 comments on commit 336cc31

Please sign in to comment.