ExceptionHandlerSet.st
author Claus Gittinger <cg@exept.de>
Sat, 06 Jun 2015 13:42:28 +0200
changeset 18449 48c31fe80359
parent 15063 5f491d49189d
child 18045 c0c600e0d3b3
child 19444 70d035d69cf1
permissions -rw-r--r--
class: Timestamp changed: #readFrom:format:language:onError: fix in Y format reading
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4466
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4464
diff changeset
     1
"
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4464
diff changeset
     2
 COPYRIGHT (c) 1999 by eXept Software AG
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4464
diff changeset
     3
              All Rights Reserved
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4464
diff changeset
     4
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4464
diff changeset
     5
 This software is furnished under a license and may be used
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4464
diff changeset
     6
 only in accordance with the terms of that license and with the
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4464
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4464
diff changeset
     8
 be provided or otherwise made available to, or used by, any
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4464
diff changeset
     9
 other person.  No title to or ownership of the software is
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4464
diff changeset
    10
 hereby transferred.
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4464
diff changeset
    11
"
6206
59d1ec1e1ed5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4546
diff changeset
    12
"{ Package: 'stx:libbasic' }"
59d1ec1e1ed5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4546
diff changeset
    13
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    14
IdentityDictionary subclass:#ExceptionHandlerSet
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    15
	instanceVariableNames:''
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    16
	classVariableNames:''
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    17
	poolDictionaries:''
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    18
	category:'Kernel-Exceptions'
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    19
!
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    20
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    21
!ExceptionHandlerSet class methodsFor:'documentation'!
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    22
4466
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4464
diff changeset
    23
copyright
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4464
diff changeset
    24
"
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4464
diff changeset
    25
 COPYRIGHT (c) 1999 by eXept Software AG
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4464
diff changeset
    26
              All Rights Reserved
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4464
diff changeset
    27
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4464
diff changeset
    28
 This software is furnished under a license and may be used
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4464
diff changeset
    29
 only in accordance with the terms of that license and with the
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4464
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4464
diff changeset
    31
 be provided or otherwise made available to, or used by, any
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4464
diff changeset
    32
 other person.  No title to or ownership of the software is
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4464
diff changeset
    33
 hereby transferred.
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4464
diff changeset
    34
"
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4464
diff changeset
    35
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4464
diff changeset
    36
!
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4464
diff changeset
    37
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    38
documentation
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    39
"
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    40
    A ExceptionHandlerSet allows a group of unrelated signals to be handled
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    41
    by individual handlers - their evaluation is equivalent to a corresponding
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    42
    number of nested signal handlers, but more efficient and
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    43
    somwehat easier to program.
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    44
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    45
    [author:]
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    46
        Stefan Vogel
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    47
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    48
    [see also:]
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    49
        Exception Signal SignalSet
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    50
"
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    51
!
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    52
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    53
examples
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    54
"
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    55
                                                                [exBegin]
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    56
         |h num|
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    57
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    58
         h := ExceptionHandlerSet new.
8290
520c27f8cae2 examples
Stefan Vogel <sv@exept.de>
parents: 8237
diff changeset
    59
         h on:ZeroDivide
520c27f8cae2 examples
Stefan Vogel <sv@exept.de>
parents: 8237
diff changeset
    60
           do:[:ex | 'division by zero' printCR. ex proceed].
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    61
8290
520c27f8cae2 examples
Stefan Vogel <sv@exept.de>
parents: 8237
diff changeset
    62
         h on:HaltInterrupt
520c27f8cae2 examples
Stefan Vogel <sv@exept.de>
parents: 8237
diff changeset
    63
           do:[:ex | 'halt encountered ' printCR. ex proceed].
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    64
8290
520c27f8cae2 examples
Stefan Vogel <sv@exept.de>
parents: 8237
diff changeset
    65
         h on:DomainError
520c27f8cae2 examples
Stefan Vogel <sv@exept.de>
parents: 8237
diff changeset
    66
           do:[:ex | 'domain error  ' printCR. ex proceed].
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    67
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    68
         h handleDo:[
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    69
            num := 0.
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    70
8290
520c27f8cae2 examples
Stefan Vogel <sv@exept.de>
parents: 8237
diff changeset
    71
            'now dividing' printCR.
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    72
            1 // num.
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    73
8290
520c27f8cae2 examples
Stefan Vogel <sv@exept.de>
parents: 8237
diff changeset
    74
            'now doing bad arcSin' printCR.
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    75
            num := 50.
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    76
            num arcSin.
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    77
8290
520c27f8cae2 examples
Stefan Vogel <sv@exept.de>
parents: 8237
diff changeset
    78
            'now halting' printCR.
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    79
            self halt.
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    80
         ]
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    81
                                                                [exEnd]
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    82
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    83
                                                                [exBegin]
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    84
         |h num|
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    85
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    86
         h := ExceptionHandlerSet new.
8290
520c27f8cae2 examples
Stefan Vogel <sv@exept.de>
parents: 8237
diff changeset
    87
         h on:ZeroDivide
520c27f8cae2 examples
Stefan Vogel <sv@exept.de>
parents: 8237
diff changeset
    88
           do:[:ex | 'division by zero' printCR. ex proceed].
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    89
8290
520c27f8cae2 examples
Stefan Vogel <sv@exept.de>
parents: 8237
diff changeset
    90
         h on:HaltInterrupt
520c27f8cae2 examples
Stefan Vogel <sv@exept.de>
parents: 8237
diff changeset
    91
           do:[:ex | 'halt encountered ' printCR. ex proceed].
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    92
8290
520c27f8cae2 examples
Stefan Vogel <sv@exept.de>
parents: 8237
diff changeset
    93
         h on:DomainError
520c27f8cae2 examples
Stefan Vogel <sv@exept.de>
parents: 8237
diff changeset
    94
           do:[:ex | 'domain error ' printCR. ex proceed].
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    95
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    96
         [
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    97
            num := 0.
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    98
8290
520c27f8cae2 examples
Stefan Vogel <sv@exept.de>
parents: 8237
diff changeset
    99
            'now dividing' printCR.
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   100
            1 // num.
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   101
8290
520c27f8cae2 examples
Stefan Vogel <sv@exept.de>
parents: 8237
diff changeset
   102
            'now doing bad arcSin' printCR.
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   103
            num := 50.
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   104
            num arcSin.
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   105
8290
520c27f8cae2 examples
Stefan Vogel <sv@exept.de>
parents: 8237
diff changeset
   106
            'now halting' printCR.
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   107
            self halt.
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   108
         ] valueWithExceptionHandler:h
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   109
                                                                [exEnd]
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   110
"
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   111
! !
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   112
8478
100e53cacce4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8290
diff changeset
   113
!ExceptionHandlerSet methodsFor:'Compatibility-VW5.4'!
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   114
8478
100e53cacce4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8290
diff changeset
   115
on:aSignalOrException handle:aHandler
8237
afaad9c5cad2 Add #on:do: as synonym for #on:handle:
Stefan Vogel <sv@exept.de>
parents: 6629
diff changeset
   116
    "add a handler for aSignal to the set"
afaad9c5cad2 Add #on:do: as synonym for #on:handle:
Stefan Vogel <sv@exept.de>
parents: 6629
diff changeset
   117
8478
100e53cacce4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8290
diff changeset
   118
    self on:aSignalOrException do:aHandler
8237
afaad9c5cad2 Add #on:do: as synonym for #on:handle:
Stefan Vogel <sv@exept.de>
parents: 6629
diff changeset
   119
8478
100e53cacce4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8290
diff changeset
   120
    "Created: / 26.7.1999 / 09:51:37 / stefan"
100e53cacce4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8290
diff changeset
   121
! !
100e53cacce4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8290
diff changeset
   122
100e53cacce4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8290
diff changeset
   123
!ExceptionHandlerSet methodsFor:'adding'!
100e53cacce4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8290
diff changeset
   124
15063
5f491d49189d class: ExceptionHandlerSet
Stefan Vogel <sv@exept.de>
parents: 11636
diff changeset
   125
on:anExceptionHandler do:aHandlerBlock
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   126
    "add a handler for aSignal to the set"
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   127
15063
5f491d49189d class: ExceptionHandlerSet
Stefan Vogel <sv@exept.de>
parents: 11636
diff changeset
   128
    anExceptionHandler isBehavior ifTrue:[
8700
c416a3fb7e2f comments/category
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   129
        "load class, if not yet loaded"
15063
5f491d49189d class: ExceptionHandlerSet
Stefan Vogel <sv@exept.de>
parents: 11636
diff changeset
   130
        anExceptionHandler autoload.
8478
100e53cacce4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8290
diff changeset
   131
    ].
15063
5f491d49189d class: ExceptionHandlerSet
Stefan Vogel <sv@exept.de>
parents: 11636
diff changeset
   132
    anExceptionHandler isExceptionHandler ifFalse:[
5f491d49189d class: ExceptionHandlerSet
Stefan Vogel <sv@exept.de>
parents: 11636
diff changeset
   133
        SignalError raiseWith:anExceptionHandler errorString:' - trying to add a non-exceptionHandler to a SignalSet'.
5f491d49189d class: ExceptionHandlerSet
Stefan Vogel <sv@exept.de>
parents: 11636
diff changeset
   134
    ].
5f491d49189d class: ExceptionHandlerSet
Stefan Vogel <sv@exept.de>
parents: 11636
diff changeset
   135
    self at:anExceptionHandler put:aHandlerBlock
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   136
! !
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   137
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   138
!ExceptionHandlerSet methodsFor:'queries'!
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   139
8681
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8589
diff changeset
   140
accepts:anExceptionHandler
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   141
    "return true, if the receiver accepts the argument, aSignal.
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   142
     (i.e. if any of the receivers elements is aSignal or a parent of it)."
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   143
8681
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8589
diff changeset
   144
    self keysDo:[:eachExceptionHandler | 
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8589
diff changeset
   145
        (eachExceptionHandler==anExceptionHandler 
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8589
diff changeset
   146
         or:[eachExceptionHandler accepts:anExceptionHandler]) ifTrue:[^ true].
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8589
diff changeset
   147
    ].
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   148
    ^ false
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   149
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   150
    "Created: / 26.7.1999 / 09:53:09 / stefan"
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   151
!
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   152
8681
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8589
diff changeset
   153
exceptionHandlerFor:anException in:aContext
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8589
diff changeset
   154
    "answer the exceptionHandler for anException from aContext."
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8589
diff changeset
   155
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8589
diff changeset
   156
    ^ self
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8589
diff changeset
   157
!
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8589
diff changeset
   158
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   159
handlerForSignal:signal
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   160
    "answer the handler block for signal"
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   161
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   162
    self keysAndValuesDo:[:sig :handler|
4513
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   163
        (sig == signal or:[sig accepts:signal]) ifTrue:[
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   164
            ^ handler.
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   165
        ].
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   166
    ].
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   167
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   168
    ^ nil
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   169
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   170
    "Modified: / 26.7.1999 / 09:59:43 / stefan"
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   171
    "Created: / 26.7.1999 / 11:29:29 / stefan"
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   172
!
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   173
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   174
handlerForSignal:signal context:theContext originator:originator
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   175
    "answer the handler block for the signal from originator.
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   176
     The block is retrieved from aContext.
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   177
     Answer nil if the signal is not handled"
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   178
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   179
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   180
    (theContext selector ~~ #'handleDo:from:'
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   181
     or:[(theContext argAt:2) == originator]) ifTrue:[
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   182
        self keysAndValuesDo:[:sig :handler|
4513
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   183
            (sig == signal or:[sig accepts:signal]) ifTrue:[
11636
2a4feb56ca70 changed #handlerForSignal:context:originator:
Stefan Vogel <sv@exept.de>
parents: 8700
diff changeset
   184
                ^ handler ? [nil].
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   185
            ].
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   186
        ].
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   187
    ].
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   188
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   189
    ^ nil
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   190
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   191
    "Created: / 26.7.1999 / 09:53:28 / stefan"
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   192
    "Modified: / 26.7.1999 / 09:59:43 / stefan"
4473
793078981f01 added #handlingSignalInContext:
Claus Gittinger <cg@exept.de>
parents: 4466
diff changeset
   193
!
793078981f01 added #handlingSignalInContext:
Claus Gittinger <cg@exept.de>
parents: 4466
diff changeset
   194
4546
ecd03e12cce3 Add #handlerProtectedBlock:inContext
Stefan Vogel <sv@exept.de>
parents: 4513
diff changeset
   195
handlerProtectedBlock:doBlock inContext:context
ecd03e12cce3 Add #handlerProtectedBlock:inContext
Stefan Vogel <sv@exept.de>
parents: 4513
diff changeset
   196
    "set the handlerProtectedBlock in context"
ecd03e12cce3 Add #handlerProtectedBlock:inContext
Stefan Vogel <sv@exept.de>
parents: 4513
diff changeset
   197
ecd03e12cce3 Add #handlerProtectedBlock:inContext
Stefan Vogel <sv@exept.de>
parents: 4513
diff changeset
   198
    context argAt:1 put:doBlock.
ecd03e12cce3 Add #handlerProtectedBlock:inContext
Stefan Vogel <sv@exept.de>
parents: 4513
diff changeset
   199
ecd03e12cce3 Add #handlerProtectedBlock:inContext
Stefan Vogel <sv@exept.de>
parents: 4513
diff changeset
   200
    "
ecd03e12cce3 Add #handlerProtectedBlock:inContext
Stefan Vogel <sv@exept.de>
parents: 4513
diff changeset
   201
      |s|
ecd03e12cce3 Add #handlerProtectedBlock:inContext
Stefan Vogel <sv@exept.de>
parents: 4513
diff changeset
   202
ecd03e12cce3 Add #handlerProtectedBlock:inContext
Stefan Vogel <sv@exept.de>
parents: 4513
diff changeset
   203
      s := ExceptionHandlerSet new.
ecd03e12cce3 Add #handlerProtectedBlock:inContext
Stefan Vogel <sv@exept.de>
parents: 4513
diff changeset
   204
      s at:Error put:[:ex| ex restartDo:[55]].
ecd03e12cce3 Add #handlerProtectedBlock:inContext
Stefan Vogel <sv@exept.de>
parents: 4513
diff changeset
   205
ecd03e12cce3 Add #handlerProtectedBlock:inContext
Stefan Vogel <sv@exept.de>
parents: 4513
diff changeset
   206
      s handleDo:[1 // 0]
ecd03e12cce3 Add #handlerProtectedBlock:inContext
Stefan Vogel <sv@exept.de>
parents: 4513
diff changeset
   207
    "
ecd03e12cce3 Add #handlerProtectedBlock:inContext
Stefan Vogel <sv@exept.de>
parents: 4513
diff changeset
   208
ecd03e12cce3 Add #handlerProtectedBlock:inContext
Stefan Vogel <sv@exept.de>
parents: 4513
diff changeset
   209
!
ecd03e12cce3 Add #handlerProtectedBlock:inContext
Stefan Vogel <sv@exept.de>
parents: 4513
diff changeset
   210
8681
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8589
diff changeset
   211
handles:anException
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8589
diff changeset
   212
    "return true, if the receiver handles the argument, anException.
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8589
diff changeset
   213
     (i.e. if any of the receivers elements handles anException)."
4473
793078981f01 added #handlingSignalInContext:
Claus Gittinger <cg@exept.de>
parents: 4466
diff changeset
   214
8681
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8589
diff changeset
   215
    self keysDo:[:eachExceptionHandler| 
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8589
diff changeset
   216
        (eachExceptionHandler handles:anException) ifTrue:[^ true]
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8589
diff changeset
   217
    ].
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8589
diff changeset
   218
    ^ false
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   219
! !
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   220
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   221
!ExceptionHandlerSet methodsFor:'save evaluation'!
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   222
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   223
handleDo:aBlock
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   224
    "evaluate the argument, aBlock.
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   225
     If any of the signals in the receiver is raised during evaluation,
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   226
     evaluate the handleBlock passing it an Exception argument.
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   227
     The handler may decide how to react to the signal by sending
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   228
     a corresponding message to the exception (see there).
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   229
     If the signal is not raised, return the value of evaluating
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   230
     aBlock."
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   231
4546
ecd03e12cce3 Add #handlerProtectedBlock:inContext
Stefan Vogel <sv@exept.de>
parents: 4513
diff changeset
   232
    <context: #return>
4491
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   233
    <exception: #handle>
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   234
4491
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   235
    "/ thisContext markForHandle. -- same as above pragma
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   236
    ^ aBlock value  "the real logic is in Exception>>doRaise"
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   237
4491
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   238
   "
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   239
    |h num|
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   240
4491
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   241
    h := ExceptionHandlerSet new.
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   242
    h on:(Number divisionByZeroSignal)
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   243
      handle:[:ex | 'division by zero' printNL. ex proceed].
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   244
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   245
    h on:(Object haltSignal)
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   246
      handle:[:ex | 'halt encountered ' printNL. ex proceed].
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   247
4491
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   248
    h on:(Float domainErrorSignal)
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   249
      handle:[:ex | 'domain error  ' printNL. ex proceed].
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   250
4491
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   251
    h handleDo:[
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   252
       num := 0.
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   253
4491
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   254
       'now dividing' printNL.
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   255
       1 // num.
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   256
4491
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   257
       'now doing bad arcSin' printNL.
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   258
       num := 50.
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   259
       num arcSin.
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   260
4491
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   261
       'now halting' printNL.
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   262
       self halt.
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   263
    ]
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   264
    "
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   265
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   266
    "Created: / 26.7.1999 / 09:56:44 / stefan"
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   267
    "Modified: / 26.7.1999 / 11:01:53 / stefan"
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   268
!
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   269
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   270
handleDo:aBlock from:originator
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   271
    "evaluate the argument, aBlock.
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   272
     If any of the signals in the receiver is raised during evaluation,
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   273
     evaluate the handleBlock passing it an Exception argument.
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   274
     The handler may decide how to react to the signal by sending
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   275
     a corresponding message to the exception (see there).
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   276
     If the signal is not raised, return the value of evaluating
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   277
     aBlock."
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   278
4546
ecd03e12cce3 Add #handlerProtectedBlock:inContext
Stefan Vogel <sv@exept.de>
parents: 4513
diff changeset
   279
    <context: #return>
4491
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   280
    <exception: #handle>
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   281
4491
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   282
    "/ thisContext markForHandle. -- same as above pragma
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   283
    ^ aBlock value  "the real logic is in Exception>>doRaise"
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   284
4491
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   285
   "
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   286
    |h num|
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   287
4491
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   288
    h := ExceptionHandlerSet new.
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   289
    h on:(Number divisionByZeroSignal)
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   290
      handle:[:ex | 'division by zero' printNL. ex proceed].
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   291
4491
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   292
    h on:(Object haltSignal)
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   293
      handle:[:ex | 'halt encountered ' printNL. ex proceed].
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   294
4491
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   295
    h on:(Float domainErrorSignal)
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   296
      handle:[:ex | 'domain error  ' printNL. ex proceed].
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   297
4491
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   298
    h handleDo:[
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   299
       'now halting' printNL.
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   300
       self halt.
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   301
4491
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   302
       'the following exceptions are not handled.
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   303
        A debugger is opened' printNL.
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   304
4491
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   305
       'now dividing' printNL.
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   306
       num := 0.
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   307
       1 // num.
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   308
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   309
       'now doing bad arcSin' printNL.
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   310
       num := 50.
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   311
       num arcSin.
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   312
    ] from:self
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   313
    "
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   314
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   315
    "Created: / 26.7.1999 / 09:56:44 / stefan"
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   316
    "Modified: / 26.7.1999 / 11:36:47 / stefan"
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   317
! !
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   318
8700
c416a3fb7e2f comments/category
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   319
!ExceptionHandlerSet methodsFor:'testing'!
c416a3fb7e2f comments/category
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   320
c416a3fb7e2f comments/category
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   321
isExceptionHandler
c416a3fb7e2f comments/category
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   322
    "return true, if the receiver responds to the exception handler protocol,
c416a3fb7e2f comments/category
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   323
     especially to the #accepts: and #handles: messages"
c416a3fb7e2f comments/category
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   324
c416a3fb7e2f comments/category
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   325
    ^ true
c416a3fb7e2f comments/category
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   326
! !
c416a3fb7e2f comments/category
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   327
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   328
!ExceptionHandlerSet class methodsFor:'documentation'!
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   329
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   330
version
15063
5f491d49189d class: ExceptionHandlerSet
Stefan Vogel <sv@exept.de>
parents: 11636
diff changeset
   331
    ^ '$Header: /cvs/stx/stx/libbasic/ExceptionHandlerSet.st,v 1.18 2013-04-04 09:37:41 stefan Exp $'
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   332
! !
15063
5f491d49189d class: ExceptionHandlerSet
Stefan Vogel <sv@exept.de>
parents: 11636
diff changeset
   333