|
Class: ProceedingNotification
Object
|
+--GenericException
|
+--Notification
|
+--ProceedingNotification
|
+--SimpleView::AboutToOpenBoxNotificationSignal
|
+--SimpleView::BoxClosedNotificationSignal
|
+--SimpleView::CloseBoxNotificationSignal
- Package:
- stx:libbasic
- Category:
- Kernel-Exceptions
- Version:
- rev:
1.3
date: 2018/05/15 18:23:41
- user: stefan
- file: ProceedingNotification.st directory: libbasic
- module: stx stc-classLibrary: libbasic
- Author:
- Claus Gittinger
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).
Exception
Query
Notification
initialization
-
initialize
-
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
]
].
|
|