We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
#wait
1 parent 7773705 commit 72ca9caCopy full SHA for 72ca9ca
lib/async/task.rb
@@ -190,7 +190,7 @@ def wait
190
@finished.wait
191
end
192
193
- if @result.is_a?(Exception)
+ if @status == :failed
194
raise @result
195
else
196
return @result
test/async/task.rb
@@ -711,6 +711,13 @@ def sleep_forever
711
expect(error_task).to be(:finished?)
712
expect(innocent_task).to be(:finished?)
713
714
+
715
+ it "will not raise exception values returned by the task" do
716
+ error = StandardError.new
717
+ task = reactor.async { error }
718
+ expect(task.wait).to be == error
719
+ expect(task.result).to be == error
720
+ end
721
722
723
with '#result' do
0 commit comments