Skip to content

Commit af9885f

Browse files
committed
Fix: Concurrent.zip value! logs errors and raise Concurrent::Error
1 parent b4e7e18 commit af9885f

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

lib/concurrent/edge/future.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ def exception(*args)
603603
raise 'obligation is not failed' unless failed?
604604
reason = @State.get.reason
605605
if reason.is_a?(Array)
606-
reason.each { |e| log Error, 'Edge::Future', e }
606+
reason.each { |e| log ERROR, 'Edge::Future', e }
607607
Concurrent::Error.new 'multiple exceptions, inspect log'
608608
else
609609
reason.exception(*args)

spec/concurrent/edge/future_spec.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,17 @@
178178

179179
expect(Concurrent.zip.wait(0.1)).to eq true
180180
end
181+
182+
context 'when a future raises an error' do
183+
184+
let(:future) { Concurrent.future { raise 'error' } }
185+
186+
it 'raises a concurrent error' do
187+
expect { Concurrent.zip(future).value! }.to raise_error(Concurrent::Error)
188+
end
189+
190+
end
191+
181192
end
182193

183194
describe 'Future' do

0 commit comments

Comments
 (0)