Open
Description
The following test passes:
testFutureRejectionVisibleError
| p exceptionSeen |
exceptionSeen := false.
p := 1 future / 0.
[
self assert: (self waitUntil: [p isRejected] orCycleCount: 100)
] on: ZeroDivide do: [:ex | exceptionSeen := true ].
self assert: exceptionSeen.
self assert: p isRejected.
self assert: ZeroDivide equals: p error class.
The following test, which only wraps the computation into a BlockClosure fails:
testFutureRejectionVisibleErrorInBlock
| p exceptionSeen |
exceptionSeen := false.
p := [:a | ZeroDivide signal. a + 2] future value: 5.
p then: [:v | v + 10].
[
self assert: (self waitUntil: [p isRejected] orCycleCount: 100)
] on: ZeroDivide do: [:ex | exceptionSeen := true ].
self assert: exceptionSeen.
self assert: p isRejected.
self assert: ZeroDivide equals: p error class.