pretty_timeouts 1.0 → 1.1

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: 9c0839882dc543b13e140d14043636d4f7513330
4
- data.tar.gz: 4c1fe3676511c4646b1f5df0543e43c2a48474e4
3
+ metadata.gz: c0f3c4e90786e50ee934e37c899f0163ba53e056
4
+ data.tar.gz: a8a440143d014a7c7de84d9e9c98e1ccdc6c78f3
5
5
  SHA512:
6
- metadata.gz: 1e8c203f51c9ef2ec894bc495f874ac597d3b9f7bdbea15155ccef7af211b8e4a68aafa1f1e76a3e9f96e8892acec75a42c64e32e8f4eab54f8f2ae730dfaf8d
7
- data.tar.gz: 2ab65bc58bf32accfa8fd3c443caa8296eb54ee22421e37d01b96b213eb9bf65c493d40da62a50e2f2ce0d31cbc1791b39729bff588f6c9d522c8a1fe9eee966
6
+ metadata.gz: 8fd5f9c892e0cd82e906c7235b0d3111fa4e9970136f48aa895eefa2e2c853d0d3e2f59872f844db77eccdd8cce6b1a3361ca08308090370f7214c6b46952065
7
+ data.tar.gz: 44e6e3431ef5232334a5216d209690b116fceffa0ffbad66890e45b2058975b717df12cbb096bfe5891414b32c306261ce9345a44e82c3d32d5ddd4d9585eb32
data/CHANGELOG.md ADDED
@@ -0,0 +1,9 @@
1
+ # Change Log
2
+ All notable changes to this project will be documented in this file.
3
+ This project adheres to [Semantic Versioning](http://semver.org/).
4
+ CHANGELOG inspiration from http://keepachangelog.com/.
5
+
6
+ ## Unreleased
7
+
8
+ ## [1.1] - March 17, 2016
9
+ * Build error with info so that rescueing classes have more to work with.
data/README.md CHANGED
@@ -54,7 +54,7 @@ git commits and tags, and push the `.gem` file to
54
54
  ## Contributing
55
55
 
56
56
  Bug reports and pull requests are welcome on GitHub at
57
- https://github.com/[USERNAME]/pretty_timeouts.
57
+ https://github.com/avvo/pretty_timeouts.
58
58
 
59
59
  ## License
60
60
 
@@ -2,7 +2,7 @@ require "pretty_timeouts/version"
2
2
  require "faraday"
3
3
 
4
4
  module PrettyTimeouts
5
- TimeoutError = Class.new(Faraday::Error::TimeoutError)
6
5
  end
7
6
 
7
+ require "pretty_timeouts/timeout_error"
8
8
  require "pretty_timeouts/middleware"
@@ -9,9 +9,7 @@ module PrettyTimeouts
9
9
  begin
10
10
  @app.call(env)
11
11
  rescue Faraday::Error::TimeoutError => e
12
- timeout = env[:request][:timeout]
13
- url = env[:url]
14
- error = ::PrettyTimeouts::TimeoutError.new("#{@service_name} timeout of #{timeout}s reached attempting to connect to #{url}")
12
+ error = ::PrettyTimeouts::TimeoutError.new(@service_name, env[:request][:timeout], env[:url])
15
13
  error.set_backtrace e.backtrace
16
14
  raise error
17
15
  end
@@ -0,0 +1,15 @@
1
+ module PrettyTimeouts
2
+ class TimeoutError < ::Faraday::Error::TimeoutError
3
+ attr_reader :service_name, :timeout, :url
4
+
5
+ def initialize(service_name, timeout, url)
6
+ @service_name = service_name
7
+ @timeout = timeout
8
+ @url = url
9
+ end
10
+
11
+ def message
12
+ "#{service_name} timeout of #{timeout}s reached attempting to connect to #{url}"
13
+ end
14
+ end
15
+ end
@@ -1,3 +1,3 @@
1
1
  module PrettyTimeouts
2
- VERSION = "1.0"
2
+ VERSION = "1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pretty_timeouts
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.0'
4
+ version: '1.1'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Donald Plummer
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-03-16 00:00:00.000000000 Z
11
+ date: 2016-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -76,6 +76,7 @@ files:
76
76
  - ".gitignore"
77
77
  - ".rspec"
78
78
  - ".travis.yml"
79
+ - CHANGELOG.md
79
80
  - Gemfile
80
81
  - LICENSE.txt
81
82
  - README.md
@@ -84,6 +85,7 @@ files:
84
85
  - bin/setup
85
86
  - lib/pretty_timeouts.rb
86
87
  - lib/pretty_timeouts/middleware.rb
88
+ - lib/pretty_timeouts/timeout_error.rb
87
89
  - lib/pretty_timeouts/version.rb
88
90
  - pretty_timeouts.gemspec
89
91
  homepage: https://github.com/avvo/pretty_timeouts