|
Class: ProceedingNotification
Object
|
+--GenericException
|
+--Notification
|
+--ProceedingNotification
|
+--SimpleView::AboutToOpenBoxNotificationSignal
|
+--SimpleView::BoxClosedNotificationSignal
|
+--SimpleView::CloseBoxRequestSignal
- Package:
- stx:libbasic
- Category:
- Kernel-Exceptions
- Version:
- rev:
1.5
date: 2021/11/21 10:09:02
- user: cg
- file: ProceedingNotification.st directory: libbasic
- module: stx stc-classLibrary: libbasic
A ProceedingNotification behaves much like a regular notification,
in that if no handler is present, execution proceeds after the raise.
However, iff a handler simply falls through, the exception is proceeded.
The handler is still free to choose for an explicit action (return/reject).
copyrightCOPYRIGHT (c) 2013 by eXept Software AG
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
default actions
-
doCallHandler: aHandlerBlock
-
call the handler proper - if the handler falls through, proceed with the handler's value.
- an extra method is needed to have a raise-marked context around.
(see implementation of #reject and #proceed).
Notice, that in contrast to a regular Notification, the execution proceeds after the Notification:
|zero|
zero := 0.
ProceedingNotification handle:[:n |
Transcript showCR:'h: ' , n description.
] do:[
Error handle:[:ex |
Transcript showCR:'some error: ' , ex errorString.
ex proceed
] do:[
[
|answer|
1 // zero. 'an error which is caught in the handler'.
answer := ProceedingNotification notify:'hello world'.
Transcript show:'after notification: '; showCR:answer.
] value
]
].
|
however, if the handler returns, this is not the case:
|zero|
zero := 0.
ProceedingNotification handle:[:n |
Transcript showCR:'h: ' , n description.
n return.
] do:[
Error handle:[:ex |
Transcript showCR:'some error: ' , ex errorString.
ex proceed
] do:[
[
|answer|
1 // zero. 'an error which is caught in the handler'.
answer := ProceedingNotification notify:'hello world'.
Transcript show:'after notification 1: '; showCR:answer.
] value
]
].
|
|