pretty_timeouts 1.0 → 1.1
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 +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +1 -1
- data/lib/pretty_timeouts.rb +1 -1
- data/lib/pretty_timeouts/middleware.rb +1 -3
- data/lib/pretty_timeouts/timeout_error.rb +15 -0
- data/lib/pretty_timeouts/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0f3c4e90786e50ee934e37c899f0163ba53e056
|
4
|
+
data.tar.gz: a8a440143d014a7c7de84d9e9c98e1ccdc6c78f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
data/lib/pretty_timeouts.rb
CHANGED
@@ -9,9 +9,7 @@ module PrettyTimeouts
|
|
9
9
|
begin
|
10
10
|
@app.call(env)
|
11
11
|
rescue Faraday::Error::TimeoutError => e
|
12
|
-
|
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
|
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.
|
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-
|
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
|