circuit_breakage 0.2.0 → 0.2.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: 5aeb1835130f99946eddad6d46d8f01dd44a0fed
4
- data.tar.gz: bdd92ef38ba1a708da8ac1cab7e9bb34c1b4fe8d
3
+ metadata.gz: d59c7f0387657741b8cdb896c9fbc9bdeb130c09
4
+ data.tar.gz: d54f9a2a8c87fbb41c6d47d17d89e8c603b28062
5
5
  SHA512:
6
- metadata.gz: 73d6b93182c3bd07d75196ac21c3fb7a7ca47259183c57a512ae131821eddfb035abc65509cd3d62a9cb3deae30f148aa3d352d9a12c4362e9297ddf397bcc18
7
- data.tar.gz: f7f86f802260ab60af42d2db4031ac62110ff8081bcc681e74be062a4a376af5e00a721e33df9cd50f3dd14d33472710d70cf7fe7bdaf864de72cc41a444892a
6
+ metadata.gz: 36fd7a9668294099a94db646b5337bfa006ac50211113a357b2c37ad6b8be0b2007264e66a342280880630dcae20df289fcbada91f729eb96b2989cd3a5fe8fd
7
+ data.tar.gz: 3624cd0493809f40458e82d64aeef20ff3d55be24063eff796ae339896ba0a0ef24c2b2b8c1c1058ef50c043ff07725405beddb673490cbfa0834d3975ff505d
@@ -47,7 +47,7 @@ module CircuitBreakage
47
47
 
48
48
  def do_call(*args)
49
49
  ret_value = nil
50
- Timeout.timeout(self.timeout, CircuitTimeout) do
50
+ Timeout.timeout(self.timeout) do
51
51
  ret_value = @block.call(*args)
52
52
  end
53
53
  handle_success
@@ -74,7 +74,15 @@ module CircuitBreakage
74
74
  end
75
75
 
76
76
  self.last_exception = error
77
- raise(error)
77
+
78
+ if error.instance_of?(Timeout::Error)
79
+ # Raising an instance of Interrupt seems pretty rude, and there's no
80
+ # useful information in Timeout::Error anyway, so re-raise timeout
81
+ # errors as our own error class.
82
+ raise CircuitTimeout, "Circuit breaker timed out."
83
+ else
84
+ raise(error)
85
+ end
78
86
  end
79
87
  end
80
88
  end
@@ -1,3 +1,3 @@
1
1
  module CircuitBreakage
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: circuit_breakage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Hyland
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-01 00:00:00.000000000 Z
11
+ date: 2015-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler