Skip to content

future send of #value: to BlockClosure masks exceptions #85

Open
@codeZeilen

Description

@codeZeilen

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    base system[SCOPE] Squeak's basic (language) concerns such as Kernel, Collections, Graphics, Networkbug[WHAT] Something isn't working as expected. Automated tests beneficial. :-

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions