fast_jsonapi 1.1.0 → 1.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
  SHA256:
3
- metadata.gz: fed8f385f05f5ea345918e1e5310e3b0a36b1dfe0c7a5cf001d7eddba8374e38
4
- data.tar.gz: fb2c1aac0e54a6dae6a6c1838005995531f25b1689168caed6ecf6f6602ddc0d
3
+ metadata.gz: c8e9a2f191f153e38d68cdafd1d61432a065fa608f069cf29403e5392358f5ea
4
+ data.tar.gz: 4f11774e609f4a286850bf7a217cdb4525479097b5e594b27abf00e14586ab51
5
5
  SHA512:
6
- metadata.gz: f935259ae0fcaa99dfb30d048d1fde82c99aba7d9abd21a4162cfad35b7448614cf44086414b9e0980bc9737794db31350124f7b9533968f97563c2f7fafbe76
7
- data.tar.gz: e20e432a1a4e03f08d055cb134a894afe14e12a8c714be5330c1cc8259e6a592ff9ab4869156dc85af67ee21005bf6769660d872e8be5a9c2461b0530876d8bd
6
+ metadata.gz: dbad0552348467cbd2c40e9d49431a6995a152037e0224dcb9d2b7cf85c05656fb7a6c23e5a24ad13e8f54ab73019290096d127c55d690e33eb49df91f260ab9
7
+ data.tar.gz: a5a007f236ee50327bba65c678288a3adfb7c44d0864f2a5bcfe18f63a9275cf836e551c318d07dbd30a3eb4a705a121cea94e7d5668f702e4b119e00d73d8f0
@@ -12,7 +12,12 @@ module FastJsonapi
12
12
  # e.g. https://github.com/github/github-ds/blob/fbda5389711edfb4c10b6c6bad19311dfcb1bac1/lib/github/result.rb
13
13
  class Result
14
14
  def initialize(*rescued_exceptions)
15
- rescued_exceptions = [StandardError] if rescued_exceptions.empty?
15
+ @rescued_exceptions = if rescued_exceptions.empty?
16
+ [StandardError]
17
+ else
18
+ rescued_exceptions
19
+ end
20
+
16
21
  @value = yield
17
22
  @error = nil
18
23
  rescue *rescued_exceptions => e
@@ -33,7 +38,8 @@ module FastJsonapi
33
38
 
34
39
  def rescue
35
40
  return self if ok?
36
- Result.new { yield(@error) }
41
+
42
+ Result.new(*@rescued_exceptions) { yield(@error) }
37
43
  end
38
44
  end
39
45
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fast_jsonapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shishir Kakaraddi