esi 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aa9727ff27242716228a559ede7aca2f78e24406
4
- data.tar.gz: 3dd983abf06229b87a9dceeae89d20095cac5dad
3
+ metadata.gz: 9f9b84385a666713670f07bd37de57fa7a956c71
4
+ data.tar.gz: e7363c2c81e5274d52a871a6292e8d8cb606cd88
5
5
  SHA512:
6
- metadata.gz: 0a16ae1125f9b8feb57b33aa92ba072c29d0b5a91b82fd82de71acbdf39cb9620eaa4912423182633497e88325ccc67120838cc10a2e794f5a0091721831eea2
7
- data.tar.gz: 10adc1638f5e9daaa3af8d474ba414917832f9962e7b08483f2b3fd3a6651ff62ddfe90fe87798b73e4ccbbe9034789f75fe5dfdc3a25432ecf5f66fe74bd15c
6
+ metadata.gz: 197aeb8691000e09ea03aec8dc84bc773b1291772fde691a07e870f70e513352eeaccd18c6559e0dab9a890f26c259df48a687f3c863cb1feb29f51260ff4579
7
+ data.tar.gz: 75e2b2ba3a22d59f1176d42c3f51a405831784969edf89e153dec08ca6498e30accac4023aa88ab309d5453b9563e2750ecca3af08e534eb3dd2ffcc927cbc59
data/lib/esi.rb CHANGED
@@ -124,7 +124,7 @@ module Esi
124
124
 
125
125
  def initialize(original_exception)
126
126
  @original_exception = original_exception
127
- super(original_exception.message)
127
+ super("#{original_exception.class}: #{original_exception.message}")
128
128
  end
129
129
  end
130
130
 
@@ -1,6 +1,6 @@
1
1
  module Esi
2
2
  class Client
3
- MAX_ATTEMPTS = 5
3
+ MAX_ATTEMPTS = 3
4
4
 
5
5
  attr_accessor :refresh_callback, :access_token, :refresh_token, :expires_at
6
6
  attr_reader :logger, :oauth
@@ -82,8 +82,10 @@ module Esi
82
82
  last_ex = nil
83
83
 
84
84
  begin
85
- response = oauth.request(call.method, url, options)
86
- rescue Net::ReadTimeout => e
85
+ response = Timeout::timeout(Esi.config.timeout) do
86
+ oauth.request(call.method, url, options)
87
+ end
88
+ rescue Timeout::Error, Net::ReadTimeout => e
87
89
  last_ex = e
88
90
  logger.error "ReadTimeout received"
89
91
  sleep 2
@@ -111,7 +113,7 @@ module Esi
111
113
  logger.error "ApiUnknownError (#{response.status}): #{url}"
112
114
 
113
115
  case response.error
114
- when 'invalid_client' then
116
+ when 'invalid_client'
115
117
  raise ApiInvalidAppClientKeysError.new(response)
116
118
  else
117
119
  raise Esi::ApiUnknownError.new(response)
@@ -1,3 +1,3 @@
1
1
  module Esi
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: esi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danny Hiemstra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-30 00:00:00.000000000 Z
11
+ date: 2017-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oauth2