Skip to content

Commit cc5b393

Browse files
authored
Allow specifying Exception as workflow failure types (#286)
1 parent ee772d4 commit cc5b393

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,9 +1233,9 @@ First, install dependencies:
12331233

12341234
# Optional: Change bundler install path to be local
12351235
bundle config --local path $(pwd)/.bundle
1236-
bundle instal
1236+
bundle install
12371237

1238-
To build shared library for development use (ensure you have cloned submodules :
1238+
To build shared library for development use (ensure you have cloned submodules) :
12391239

12401240
bundle exec rake compile
12411241

temporalio/lib/temporalio/internal/worker/workflow_worker.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def initialize(
111111
disable_eager_activity_execution:,
112112
workflow_interceptors:,
113113
workflow_failure_exception_types: workflow_failure_exception_types.map do |t|
114-
unless t.is_a?(Class) && t < Exception
114+
unless t.is_a?(Class) && t <= Exception
115115
raise ArgumentError, 'All failure types must classes inheriting Exception'
116116
end
117117

temporalio/lib/temporalio/workflow/definition.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def workflow_raw_args(value = true) # rubocop:disable Style/OptionalBooleanParam
5555
# @param types [Array<Class<Exception>>] Exception types to turn into workflow failures.
5656
def workflow_failure_exception_type(*types)
5757
types.each do |t|
58-
raise ArgumentError, 'All types must classes inheriting Exception' unless t.is_a?(Class) && t < Exception
58+
raise ArgumentError, 'All types must classes inheriting Exception' unless t.is_a?(Class) && t <= Exception
5959
end
6060
@workflow_failure_exception_types ||= []
6161
@workflow_failure_exception_types.concat(types)

0 commit comments

Comments
 (0)