eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'ProceedingNotification':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: ProceedingNotification


Inheritance:

   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

Description:


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).


Related information:

    Exception
    Query
    Notification

Class protocol:

initialization
o  initialize


Instance protocol:

default actions
o  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).


Examples:


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
      ]
  ].


ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Fri, 19 Apr 2024 03:05:36 GMT