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::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

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

copyright

COPYRIGHT (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.

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.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Tue, 03 Dec 2024 17:21:19 GMT