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.
1 parent 001691a commit 183a4fcCopy full SHA for 183a4fc
lib/concurrent/edge/promises.rb
@@ -920,13 +920,14 @@ def value!(timeout = nil)
920
# @example
921
# raise Promises.rejected_future(StandardError.new("boom"))
922
# @raise [StandardError] when raising not rejected future
923
+ # @return [Exception]
924
def exception(*args)
925
raise Concurrent::Error, 'it is not rejected' unless rejected?
- reason = internal_state.reason
926
- if reason.is_a?(::Array)
+ reason = Array(internal_state.reason).compact
927
+ if reason.size > 1
928
Concurrent::MultipleErrors.new reason
929
else
- reason.exception(*args)
930
+ reason[0].exception(*args)
931
end
932
933
0 commit comments