toolx 0.2.4 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/toolx/core/operation/flow.rb +10 -3
- data/lib/toolx/version.rb +1 -1
- 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: b0df2121547a4505e9c539967d93354523870643863daa8c89e6d42fabb487e3
|
4
|
+
data.tar.gz: 9092ac6a6ad19a6e1b1ed9b5383a7c5445d770886dc5113f841172cc0db139a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71505b2554ee0e2ea44aa4eb8afbf4591404d6afccda7b3893cfc1f2378dcaef733e3a53f5abbcfa993708046d13ae61bcf28e16cf71f977725d2d70c3822309
|
7
|
+
data.tar.gz: 8f6b0a7ae009caf03a10a1ba3c328e78bfcdcdb227062bd1b6915485fbb1b55705145daaa9fb8c0e84b54e89724d9d24da18b55211fcc69b85d240ff31f74e2f
|
@@ -22,8 +22,14 @@ module Toolx::Core::Operation::Flow
|
|
22
22
|
OperationAlreadyInitialized = Class.new(ExecutorError)
|
23
23
|
OperationNotInitialized = Class.new(ExecutorError)
|
24
24
|
ActionException = Class.new(::Toolx::Core::Errors::NestedStandardError)
|
25
|
-
OnFailException = Class.new(ActionException)
|
26
25
|
OnSuccessException = Class.new(ActionException)
|
26
|
+
OnFailException = Class.new(ActionException) do
|
27
|
+
attr_reader :operation_exception
|
28
|
+
def initialize(msg = nil, nested = $ERROR_INFO, operation_exception = nil)
|
29
|
+
super(msg, nested)
|
30
|
+
@operation_exception = operation_exception
|
31
|
+
end
|
32
|
+
end
|
27
33
|
|
28
34
|
def initialize(operation_class)
|
29
35
|
@operation_class = operation_class
|
@@ -224,13 +230,14 @@ module Toolx::Core::Operation::Flow
|
|
224
230
|
begin
|
225
231
|
execute_action_kind(:success)
|
226
232
|
rescue => e
|
227
|
-
raise OnSuccessException, "Error in success action: #{e.message}", e.backtrace
|
233
|
+
raise OnSuccessException, "Error in operation success action: #{e.message}", e.backtrace
|
228
234
|
end
|
229
235
|
else
|
230
236
|
begin
|
231
237
|
execute_action_kind(:fail)
|
232
238
|
rescue => e
|
233
|
-
|
239
|
+
action_name = actions[:fail].is_a?(Symbol) ? actions[:fail] : 'block'
|
240
|
+
raise OnFailException.new("Error in operation fail action (#{action_name}): #{e.message}", e, exception)
|
234
241
|
end
|
235
242
|
end
|
236
243
|
self
|
data/lib/toolx/version.rb
CHANGED