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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 24ea4449f0a1a046d1eb279ff79a5264023e2d491a29fe065da08779973a517a
4
- data.tar.gz: 118adfc3c279eac422329ab3755ee70100c3dafa6b4102d9b9fa5e28c539df64
3
+ metadata.gz: b0df2121547a4505e9c539967d93354523870643863daa8c89e6d42fabb487e3
4
+ data.tar.gz: 9092ac6a6ad19a6e1b1ed9b5383a7c5445d770886dc5113f841172cc0db139a2
5
5
  SHA512:
6
- metadata.gz: cf1b7111d44504c36e6b0e8cd1ddccc1afa32852bc591a1440c03ffe65355bbf8f4b814004ca769b9f7d190b34ddaf0586e347e337df51b1626a0d4911796760
7
- data.tar.gz: e7083b373203caf0c77ea90f9f1e6dd9459b9d5daa24051c15673c6991baec9c519ad91f3d03de05291de6d0b667a804ca583b88568db1bdca359229d08fe03c
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
- raise OnFailException, "Error in fail action: #{e.message}", e.backtrace
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Toolx
4
- VERSION = '0.2.4'.freeze
4
+ VERSION = '0.2.6'.freeze
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: toolx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pawel Niemczyk