[squeak-dev] Re: [Pharo-project] Another finalization concern: error handling

Igor Stasenko siguctua at gmail.com
Mon Oct 11 20:42:44 UTC 2010


On 11 October 2010 23:33, Andreas Raab <andreas.raab at gmx.de> wrote:
> On 10/11/2010 1:17 PM, Igor Stasenko wrote:
>>
>> On 11 October 2010 22:49, Schwab,Wilhelm K<bschwab at anest.ufl.edu>  wrote:
>>>
>>> Sig,
>>>
>>> The most important words in there are "critical section."  Carry on :)
>>>
>>
>> Oh, please. This is not too hard to code.
>>
>> My mind rolling around following choice(s)  (there may be others i don't
>> see).
>> What would be a proper way to handle error during #finalize.
>>
>> [ executor finalize ] on: Error do: [:ex |
>>   self handleFinalizationError: ex  "where self is registry"
>>  ].
>>
>> or:
>>
>> [ executor finalize ] on: Error do: [:ex |
>>   executor handleFinalizationError: ex
>>  ].
>
> Make it a parameter (block) so that clients can tell the registry how they'd
> like to handle errors. I.e., something like:
>
>  [executor finalize] on: Error do:[:ex|
>        errorHandler ifNotNil:[errorHandler value: ex value: executor].
 ifNil: [ self defaultErrorHandler: ex executor: executor ]

right?

>  ].
>
> Cheers,
>  - Andreas
>
>> of course, i should catch this error in test, so i can verify that:
>>
>> a) test is get notified upon synthetically made error
>> b) no matter what i do inside error handler (up to 'Processor
>> activeProcess terminate'), a finalization process continues working
>> (or restarts without losing remainder of executors).
>>
>>
>> Also, i used #ensure: and #ifCurtailed: but i tend to forget where
>> they are applicable and how.
>> So, little help in this regard will be wellcome.
>>
>>> Bill
>>>
>
>
>



-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list