Review Request: BrokenPromise-compat.1.cs

Christoph Thiede via Squeak-dev <[email protected]>
Newsgroups gmane.comp.lang.smalltalk.squeak.general
Message-ID <ccf86ec1-7c7d-4088-aae9-4830a33f814e@MX2018-DAG1.hpi.uni-potsdam.de>
=============== Summary ===============

Change Set:        BrokenPromise-compat
Date:            30 April 2026
Author:            Christoph Thiede

Adds backward compatibility for BrokenPromise. See: https://lists.squeakfoundation.org/archives/list/[email protected]/thread/BHBVRXIXUFGXDLIAFGLBBZ2LCX4OKYGD/

=============== Diff ===============

BrokenPromise class>>handles: {exceptionSelector} · ct 4/30/2026 00:56
+ handles: exception
+ 
+     ^ (super handles: exception)
+         ifTrue: [self deprecated: 'BrokenPromise is deprecated. Handle Error instead. See: https://lists.squeakfoundation.org/archives/list/[email protected]/thread/BHBVRXIXUFGXDLIAFGLBBZ2LCX4OKYGD/'];
+         yourself

BrokenPromise>>defaultAction {priv handling} · ct 4/30/2026 00:51
+ defaultAction
+ 
+     ^ #ignored

BrokenPromise>>error {accessing} · ct 2/24/2024 22:11
+ error
+ 
+     ^ promise ifNotNil: [promise error]

BrokenPromise>>messageText {accessing} · ct 2/24/2024 22:13
+ messageText
+ 
+     ^ messageText ifNil:
+         [self error ifNotNil: [:error |
+             error asString]]

BrokenPromise>>promise {accessing} · tonyg 2/17/2017 13:51
+ promise
+     ^ promise

BrokenPromise>>promise: {accessing} · tonyg 2/17/2017 13:51
+ promise: aPromise
+     promise := aPromise

Promise>>signalErrorValue {waiting} · ct 4/30/2026 00:58 (changed)
signalErrorValue
+     "Backward compatibility."
+     (Smalltalk at: #BrokenPromise) ifNotNil: [:exceptionClass |
+         | result |
+         result := (exceptionClass new promise: self; signal).
+         result = #ignored ifFalse: [^ result]].
+     
    (errorValue isKindOf: Exception)
        ifTrue: [errorValue signal]
        ifFalse: [self error: 'Promise rejected']


-- 
Sent from Squeak Inbox Talk

Squeak-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
BrokenPromise-compat.1.cs (text/squeak-changes, 2 KB)
'From Squeak6.1beta of 27 April 2026 [latest update: #23774] on 30 April 2026 at 1:00:42 am'!
"Change Set:		BrokenPromise-compat
Date:			30 April 2026
Author:			Christoph Thiede

Adds backward compatibility for BrokenPromise. See: https://lists.squeakfoundation.org/archives/list/[email protected]/thread/BHBVRXIXUFGXDLIAFGLBBZ2LCX4OKYGD/"!

Notification subclass: #BrokenPromise
	instanceVariableNames: 'promise'
	classVariableNames: ''
	poolDictionaries: ''
	category: '61Deprecated-Kernel-Exceptions'!

!BrokenPromise commentStamp: 'tonyg 2/17/2017 13:53' prior: 0!
I am signalled when, during a Promise>>wait, the promise is rejected.
	promise:		the promise itself.
!


!BrokenPromise methodsFor: 'priv handling' stamp: 'ct 4/30/2026 00:51'!
defaultAction

	^ #ignored! !

!BrokenPromise methodsFor: 'accessing' stamp: 'ct 2/24/2024 22:11'!
error

	^ promise ifNotNil: [promise error]! !

!BrokenPromise methodsFor: 'accessing' stamp: 'ct 2/24/2024 22:13'!
messageText

	^ messageText ifNil:
		[self error ifNotNil: [:error |
			error asString]]! !

!BrokenPromise methodsFor: 'accessing' stamp: 'tonyg 2/17/2017 13:51'!
promise
	^ promise! !

!BrokenPromise methodsFor: 'accessing' stamp: 'tonyg 2/17/2017 13:51'!
promise: aPromise
	promise := aPromise! !


!BrokenPromise class methodsFor: 'exceptionSelector' stamp: 'ct 4/30/2026 00:56'!
handles: exception

	^ (super handles: exception)
		ifTrue: [self deprecated: 'BrokenPromise is deprecated. Handle Error instead. See: https://lists.squeakfoundation.org/archives/list/[email protected]/thread/BHBVRXIXUFGXDLIAFGLBBZ2LCX4OKYGD/'];
		yourself! !


!Promise methodsFor: 'waiting' stamp: 'ct 4/30/2026 00:58'!
signalErrorValue
	"Backward compatibility."
	(Smalltalk at: #BrokenPromise) ifNotNil: [:exceptionClass |
		| result |
		result := (exceptionClass new promise: self; signal).
		result = #ignored ifFalse: [^ result]].
	
	(errorValue isKindOf: Exception)
		ifTrue: [errorValue signal]
		ifFalse: [self error: 'Promise rejected']! !
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.