Hi Marten and Sebastian,
I think you two were working on porting Announcements to VAST...
Why did you chose to implement AnnouncementSubscription>>deliver: like this:
" deliver an announcement to receiver.
Difference to Squeak implementation:
In case of failure, nothing is done
"
^ (self handles: anAnnouncement class )
ifTrue: [
[action cull: anAnnouncement cull: announcer]
when: ExError
do: [ :sig |
"still do not know what to do ..."
sig exitWith: nil
]
]
I think this is wrong, but I am not sure if I am missing any detail that would make me agree with you.
The original implementation in Squeak, however, does at least not swallow the exception:
deliver: anAnnouncement
" deliver an announcement to receiver. In case of failure, it will be handled in separate process"
^ (self handles: anAnnouncement class ) ifTrue: [
[action cull: anAnnouncement cull: announcer]
on: UnhandledError fork: [:ex | ex pass ]]
on:fork: is not available on VAST, and I am not sure if it adds any value in this case.
Why do I think it's wrong? Because whatever exception gets thrown and is uncaught in the actions that follow the Announcement (some perform: aMethod), it will be swallowed here.
For this it means that an unimplemented method was never signalled to the developer / user.
I see three options that seem to be better to me:
a) don't catch any errors here
b) pass the exception (which is equivalent to a, but would resemble the original behavior pretty closely)
c) repackage an exception into an AnnouncementProcessingFailed (or such) exception (not sure this adds any value, but you could configure Announcements to still ignore such exceptions if you need to).
But I think eating the exception is bad in this case.
So do you remember what your initial idea was for this change?
Joachim