pebblebed 0.4.10 → 0.4.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b98d3bdf74c5e465646236db6720f627f0dc624a
4
- data.tar.gz: ef141ab3f72a2fb12f0152d892464601dc759407
3
+ metadata.gz: 62452f2f7ee12c5a5b1211348af0be3a27845221
4
+ data.tar.gz: f09064a146d9ff794015a8658d0714e5d8aca70b
5
5
  SHA512:
6
- metadata.gz: 25126f9c95fa862c985c523ef7630bcb701c464c29bc70a3702aa6bed50bee614a2f86874d1694ebe920603577b4797e639b45784722421a39ed08aa3ef89127
7
- data.tar.gz: e0bb39b5adb506a9dd132e8a96379c2000ae432a8f8720b5bc349742696c844c71d9b52ba7d8fc9fb14ee217b36374395bf5576084b32df743da7c4ba9d4d3f1
6
+ metadata.gz: 82ea3c29fbcfd2a69bcea6054b94c09da7b3e5e86920d70b2b75f80abb4f5789adf63cb55604cbbe0c01d98373d2161f3ee488dd43bd09a42df1b0fd9ccd844b
7
+ data.tar.gz: 68bc9d9fbd185abb9dc5181efe4a0ccb9d4697256456a62c1206c4993ef0d110279c7aeb35021770c89638b41df659bfa77dc1369a77198342b75e681764b9da
@@ -35,14 +35,18 @@ module Pebblebed
35
35
  end
36
36
  end
37
37
 
38
+ class HttpNotFoundError < HttpError; end
39
+
38
40
  class HttpTransportError < StandardError
39
- def initialize(e = nil)
40
- super e
41
- set_backtrace e.backtrace if e
41
+ def initialize(message, exception, url)
42
+ super(message)
43
+ set_backtrace(exception.backtrace)
44
+ @url = url
42
45
  end
46
+
47
+ attr_reader :url
43
48
  end
44
49
 
45
- class HttpNotFoundError < HttpError; end
46
50
  class HttpSocketError < HttpTransportError; end
47
51
  class HttpTimeoutError < HttpTransportError; end
48
52
 
@@ -250,10 +254,10 @@ module Pebblebed
250
254
  request = block.call(connection)
251
255
  response = Response.new(url, request.status, request.body)
252
256
  return handle_http_errors(response)
253
- rescue Excon::Errors::Timeout => error
254
- raise HttpTimeoutError.new(error)
255
- rescue Excon::Errors::SocketError => error
256
- raise HttpSocketError.new(error)
257
+ rescue Excon::Errors::Timeout => e
258
+ raise HttpTimeoutError.new("#{e} [#{url}]", e, url)
259
+ rescue Excon::Errors::SocketError => e
260
+ raise HttpSocketError.new("#{e} [#{url}]", e, url)
257
261
  end
258
262
  }
259
263
  }
@@ -264,7 +268,7 @@ module Pebblebed
264
268
  interval = 0.1
265
269
  begin
266
270
  return yield
267
- rescue HttpTimeoutError, HttpSocketError => e
271
+ rescue HttpTimeoutError, HttpSocketError
268
272
  raise if Time.now >= deadline
269
273
  sleep(interval)
270
274
  interval = [30, interval * 2].min
@@ -314,11 +318,11 @@ module Pebblebed
314
318
 
315
319
  # Returns new Excon conection from current configuration.
316
320
  def self.new_connection(url)
317
- connection = Excon.new(base_url(url), {
318
- :read_timeout => read_timeout || DEFAULT_READ_TIMEOUT,
319
- :write_timeout => write_timeout || DEFAULT_WRITE_TIMEOUT,
320
- :connect_timeout => connect_timeout || DEFAULT_CONNECT_TIMEOUT,
321
- :thread_safe_sockets => false
321
+ Excon.new(base_url(url), {
322
+ read_timeout: read_timeout || DEFAULT_READ_TIMEOUT,
323
+ write_timeout: write_timeout || DEFAULT_WRITE_TIMEOUT,
324
+ connect_timeout: connect_timeout || DEFAULT_CONNECT_TIMEOUT,
325
+ thread_safe_sockets: false
322
326
  })
323
327
  end
324
328
 
@@ -1,3 +1,3 @@
1
1
  module Pebblebed
2
- VERSION = "0.4.10"
2
+ VERSION = "0.4.11"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pebblebed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.10
4
+ version: 0.4.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katrina Owen
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-05-31 00:00:00.000000000 Z
12
+ date: 2020-02-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -332,7 +332,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
332
332
  version: '0'
333
333
  requirements: []
334
334
  rubyforge_project: pebblebed
335
- rubygems_version: 2.5.2
335
+ rubygems_version: 2.5.2.3
336
336
  signing_key:
337
337
  specification_version: 4
338
338
  summary: Development tools for working with Pebblebed