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 +4 -4
- data/lib/fast_jsonapi/multi_to_json.rb +8 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8e9a2f191f153e38d68cdafd1d61432a065fa608f069cf29403e5392358f5ea
|
4
|
+
data.tar.gz: 4f11774e609f4a286850bf7a217cdb4525479097b5e594b27abf00e14586ab51
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 =
|
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
|
-
|
41
|
+
|
42
|
+
Result.new(*@rescued_exceptions) { yield(@error) }
|
37
43
|
end
|
38
44
|
end
|
39
45
|
|