circuitbox 0.10.3 → 0.10.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/circuitbox.gemspec +0 -2
- data/lib/circuitbox/errors/service_failure_error.rb +2 -1
- data/lib/circuitbox/version.rb +1 -1
- data/test/service_failure_error_test.rb +23 -6
- metadata +2 -31
- data/Guardfile +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5dd97fd3064e288e32ebae417b38a8e4e95439e4
|
4
|
+
data.tar.gz: 0b5ede74d70a2bfeffaf8178304afb24e3ac1c61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b6dfa97e8ea99ddf7d3ff06c08460e7820a07461f8c4c9cedf84c012879ba72870ae9f032cc6047e1121024ba64329ae2f9c96929f05e90268569f6279a0c9c
|
7
|
+
data.tar.gz: 9870a54f290f71a377ae850cc02945d6f76eeec7c5dc3627cf710e67adeb844cc14eaaf4341683508fb9c81e1e8d35f7fc51f841874dbf5163c1bca251b49cf7
|
data/README.md
CHANGED
@@ -213,6 +213,10 @@ c.use Circuitbox::FaradayMiddleware, open_circuit: lambda { |response| response.
|
|
213
213
|
|
214
214
|
### version next
|
215
215
|
|
216
|
+
### v0.10.4
|
217
|
+
- Issue #39, keep the original backtrace for the wrapped exception around when
|
218
|
+
re-raising a Circuitbox::Error
|
219
|
+
|
216
220
|
### v0.10.3
|
217
221
|
- Circuitbox::ServiceFailureError wraps the original exception that was raised.
|
218
222
|
The behaviour for to_s wasn't exposing this information and was returning the
|
data/circuitbox.gemspec
CHANGED
@@ -21,8 +21,6 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.add_development_dependency "bundler"
|
22
22
|
spec.add_development_dependency "rake"
|
23
23
|
spec.add_development_dependency "rack"
|
24
|
-
spec.add_development_dependency "guard-minitest"
|
25
|
-
spec.add_development_dependency "guard"
|
26
24
|
spec.add_development_dependency "gimme"
|
27
25
|
spec.add_development_dependency "minitest"
|
28
26
|
spec.add_development_dependency "mocha"
|
@@ -5,11 +5,12 @@ class Circuitbox
|
|
5
5
|
def initialize(service, exception)
|
6
6
|
@service = service
|
7
7
|
@original = exception
|
8
|
+
# we copy over the original exceptions backtrace if there is one
|
9
|
+
set_backtrace(exception.backtrace) unless exception.backtrace.empty?
|
8
10
|
end
|
9
11
|
|
10
12
|
def to_s
|
11
13
|
"#{self.class.name} wrapped: #{original}"
|
12
14
|
end
|
13
|
-
|
14
15
|
end
|
15
16
|
end
|
data/lib/circuitbox/version.rb
CHANGED
@@ -1,13 +1,30 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
|
-
|
3
|
+
describe Circuitbox::ServiceFailureError do
|
4
4
|
class SomeOtherError < StandardError; end;
|
5
|
-
|
6
|
-
|
5
|
+
|
6
|
+
attr_reader :error
|
7
|
+
|
8
|
+
before do
|
9
|
+
begin
|
10
|
+
raise SomeOtherError, "some other error"
|
11
|
+
rescue => ex
|
12
|
+
@error = ex
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
describe '#to_s' do
|
7
17
|
it 'includes message for wrapped exception' do
|
8
|
-
|
9
|
-
|
10
|
-
assert_equal "Circuitbox::ServiceFailureError wrapped: #{some_error}", ex.to_s
|
18
|
+
ex = Circuitbox::ServiceFailureError.new('test', error)
|
19
|
+
assert_equal "Circuitbox::ServiceFailureError wrapped: #{error}", ex.to_s
|
11
20
|
end
|
12
21
|
end
|
22
|
+
|
23
|
+
describe '#backtrace' do
|
24
|
+
it 'keeps the original exception backtrace' do
|
25
|
+
ex = Circuitbox::ServiceFailureError.new('test', error)
|
26
|
+
assert_equal error.backtrace, ex.backtrace
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
13
30
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: circuitbox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fahim Ferdous
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,34 +52,6 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: guard-minitest
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: guard
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
55
|
- !ruby/object:Gem::Dependency
|
84
56
|
name: gimme
|
85
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -216,7 +188,6 @@ files:
|
|
216
188
|
- ".gitignore"
|
217
189
|
- ".travis.yml"
|
218
190
|
- Gemfile
|
219
|
-
- Guardfile
|
220
191
|
- LICENSE
|
221
192
|
- README.md
|
222
193
|
- Rakefile
|
data/Guardfile
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
# A sample Guardfile
|
2
|
-
# More info at https://github.com/guard/guard#readme
|
3
|
-
|
4
|
-
guard :minitest do
|
5
|
-
# with Minitest::Unit
|
6
|
-
watch(%r{^test/(.*)_test\.rb$})
|
7
|
-
watch(%r{^lib/circuitbox/([^/]+)\.rb$}) { |m| "test/#{m[1]}_test.rb" }
|
8
|
-
watch(%r{^test/test_helper\.rb$}) { 'test' }
|
9
|
-
end
|