[squeak-dev] On the rejection of Promises due to errors

Robert Withers robert.withers at pm.me
Tue Jun 23 12:40:46 UTC 2020

Hi Jakob,

I changed my code a little bit to open a Debugger. Yet I still have two issues.

On 6/21/20 5:53 PM, Robert Withers wrote:

> You can load the following and run the tests.
>> Installer ss project: 'Cryptography'; install: 'PromisesLocal'.

The latest PromisesLocal-rww.2.mcz has the changes. You can load with the above Installer doIt.

> I got a little lost in capturing exceptions, within the Vat's event loop #processSends. I have tickled my implementation a little to try and get the Vat event thread to throw an exception, which presents a Debugger. I have been unable to pop up the Debugger on the error, but the promise does get smashed.

I removed catch-all error handling from the PriorityVat>>#processSends. I then added to the error handling in EventualMessageSend>>#value to open a debugger after smashing the resolver.

> value
> | value |
> [value := receiver
> perform: selector
> withArguments: (self collectArguments: arguments)
> inSuperclass: receiver class.
> self resolver notNil
> ifTrue: [ self resolver resolve: value ] ]
> on: Exception
> do: [:ex |
> self resolver notNil
> ifTrue: [self resolver smash: ex].
> Processor activeProcess signalException: ex].

I have a couple of issues with this:

- When I close the debugger, the EventualProcess with the stack that ended up in this exception is terminated. I would need this process to restart and continue, after clearing the stack from this exception. I am unsure how to make that happen. Any suggestions are MOST WELCOME!
- The stack in the Debugger is not opened on the stack frame that causes the failure. I would like to rewind the stack to the bolded line, where the exception is produced, in this case it would be the method: ZeroDivide(Exception)>>signal. Is this not where the Debugger should be opened? Again, I am unsure how to do this and all suggestions are MOST WELCOME!

>> --- The full stack ---
>> EventualProcess(Process)>>signalException:
>> [] in EventualMessageSend>>value
>> FullBlockClosure(BlockClosure)>>cull:
>> [] in Context>>handleSignal:
>> FullBlockClosure(BlockClosure)>>ensure:
>> Context>>handleSignal:
>> ZeroDivide(Exception)>>signal
>> SmallInteger>>/
>> [] in EventualMessageSend>>value
>> FullBlockClosure(BlockClosure)>>on:do:
>> EventualMessageSend>>value
>> PriorityVat>>processSends
>> [] in EventualProcess>>setupContext


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200623/2b02d3fe/attachment.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Walkback.text
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200623/2b02d3fe/attachment.text>

More information about the Squeak-dev mailing list