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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 33b29e5d48278413b699741f144fdde38057ad46
4
- data.tar.gz: f4d2897cf0f020aab8ace760976099104e308afc
3
+ metadata.gz: 5dd97fd3064e288e32ebae417b38a8e4e95439e4
4
+ data.tar.gz: 0b5ede74d70a2bfeffaf8178304afb24e3ac1c61
5
5
  SHA512:
6
- metadata.gz: 69b31ae9c7fa29fb6400c40da41baeb5d63d6cc625d82c64c00aa0a2cf7eaaf5a1d02a184672a5135481310d9be7ee4ef949b38b0763d99814c2c5aa3f89ea70
7
- data.tar.gz: aad5e9f545af39c9fbd792d8b76c8c06202461b32c7113522115cda8da6095bb66cdaaac6591e5edbc8e69ead22ba96c611ee9523efd589f3f16b66a22577992
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
@@ -1,3 +1,3 @@
1
1
  class Circuitbox
2
- VERSION='0.10.3'
2
+ VERSION='0.10.4'
3
3
  end
@@ -1,13 +1,30 @@
1
1
  require 'test_helper'
2
2
 
3
- class ServiceFailureErrorTest < Minitest::Test
3
+ describe Circuitbox::ServiceFailureError do
4
4
  class SomeOtherError < StandardError; end;
5
-
6
- describe 'to_s' do
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
- some_error = SomeOtherError.new("some other error")
9
- ex = Circuitbox::ServiceFailureError.new('test', some_error)
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.3
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-06-16 00:00:00.000000000 Z
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