Signal.st
author Claus Gittinger <cg@exept.de>
Tue, 09 Jul 2019 20:55:17 +0200
changeset 24417 03b083548da2
parent 23886 678caed54a3c
permissions -rw-r--r--
#REFACTORING by exept class: Smalltalk class changed: #recursiveInstallAutoloadedClassesFrom:rememberIn:maxLevels:noAutoload:packageTop:showSplashInLevels: Transcript showCR:(... bindWith:...) -> Transcript showCR:... with:...
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
22797
094ff40472f3 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 22496
diff changeset
     1
"{ Encoding: utf8 }"
094ff40472f3 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 22496
diff changeset
     2
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
     3
"
a27a279701f8 Initial revision
claus
parents:
diff changeset
     4
 COPYRIGHT (c) 1993 by Claus Gittinger
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
     5
	      All Rights Reserved
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
     6
a27a279701f8 Initial revision
claus
parents:
diff changeset
     7
 This software is furnished under a license and may be used
a27a279701f8 Initial revision
claus
parents:
diff changeset
     8
 only in accordance with the terms of that license and with the
a27a279701f8 Initial revision
claus
parents:
diff changeset
     9
 inclusion of the above copyright notice.   This software may not
a27a279701f8 Initial revision
claus
parents:
diff changeset
    10
 be provided or otherwise made available to, or used by, any
a27a279701f8 Initial revision
claus
parents:
diff changeset
    11
 other person.  No title to or ownership of the software is
a27a279701f8 Initial revision
claus
parents:
diff changeset
    12
 hereby transferred.
a27a279701f8 Initial revision
claus
parents:
diff changeset
    13
"
5515
4adb4b3a7475 category only
Claus Gittinger <cg@exept.de>
parents: 5300
diff changeset
    14
"{ Package: 'stx:libbasic' }"
4adb4b3a7475 category only
Claus Gittinger <cg@exept.de>
parents: 5300
diff changeset
    15
18726
36732bc5400c class: Signal
Claus Gittinger <cg@exept.de>
parents: 16562
diff changeset
    16
"{ NameSpace: Smalltalk }"
36732bc5400c class: Signal
Claus Gittinger <cg@exept.de>
parents: 16562
diff changeset
    17
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    18
Object subclass:#Signal
4564
5401b0d1a6e3 NoHandlerSignal proceedability
Stefan Vogel <sv@exept.de>
parents: 4563
diff changeset
    19
	instanceVariableNames:'mayProceed notifierString nameClass message handlerBlock parent'
5401b0d1a6e3 NoHandlerSignal proceedability
Stefan Vogel <sv@exept.de>
parents: 4563
diff changeset
    20
	classVariableNames:''
5401b0d1a6e3 NoHandlerSignal proceedability
Stefan Vogel <sv@exept.de>
parents: 4563
diff changeset
    21
	poolDictionaries:''
5401b0d1a6e3 NoHandlerSignal proceedability
Stefan Vogel <sv@exept.de>
parents: 4563
diff changeset
    22
	category:'Kernel-Exceptions'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    23
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    24
2207
ee6d4213b9df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1610
diff changeset
    25
!Signal class methodsFor:'documentation'!
44
b262907c93ea *** empty log message ***
claus
parents: 27
diff changeset
    26
88
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    27
copyright
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    28
"
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    29
 COPYRIGHT (c) 1993 by Claus Gittinger
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
    30
	      All Rights Reserved
88
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    31
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    32
 This software is furnished under a license and may be used
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    33
 only in accordance with the terms of that license and with the
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    34
 inclusion of the above copyright notice.   This software may not
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    35
 be provided or otherwise made available to, or used by, any
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    36
 other person.  No title to or ownership of the software is
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    37
 hereby transferred.
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    38
"
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    39
!
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    40
44
b262907c93ea *** empty log message ***
claus
parents: 27
diff changeset
    41
documentation
b262907c93ea *** empty log message ***
claus
parents: 27
diff changeset
    42
"
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
    43
    Note:
20091
386d81725b8f #OTHER by mawalch
mawalch
parents: 18726
diff changeset
    44
        The instance based Signal framework is being replaced by class based exceptions.
20953
e84cf4c25b59 #OTHER by mawalch
mawalch
parents: 20820
diff changeset
    45
        I.e. what used to be instances of Signal/QuerySignal is being
20091
386d81725b8f #OTHER by mawalch
mawalch
parents: 18726
diff changeset
    46
        rewritten into subclasses of Exception/Error/Query and Warning.
8384
8b1ae350bcc1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8292
diff changeset
    47
20091
386d81725b8f #OTHER by mawalch
mawalch
parents: 18726
diff changeset
    48
        Although the functionality is basically unchanged, the new
386d81725b8f #OTHER by mawalch
mawalch
parents: 18726
diff changeset
    49
        class based exceptions are easier to instantiate (no need for
386d81725b8f #OTHER by mawalch
mawalch
parents: 18726
diff changeset
    50
        creation in a classes initialize method), easier to use (no real
386d81725b8f #OTHER by mawalch
mawalch
parents: 18726
diff changeset
    51
        need for Signal-constant accessors) and allow for easier parameter
386d81725b8f #OTHER by mawalch
mawalch
parents: 18726
diff changeset
    52
        passing (not only a single parameter, but allows for individual
386d81725b8f #OTHER by mawalch
mawalch
parents: 18726
diff changeset
    53
        exception subclasses to add additional state).
6429
d0a5a78e6227 better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents: 6396
diff changeset
    54
20091
386d81725b8f #OTHER by mawalch
mawalch
parents: 18726
diff changeset
    55
        However, the old Signal hierarchy will remain in existance, since it allows
386d81725b8f #OTHER by mawalch
mawalch
parents: 18726
diff changeset
    56
        funny instance-specific and anonymous exception handling schemes to be
386d81725b8f #OTHER by mawalch
mawalch
parents: 18726
diff changeset
    57
        implemented, which are hard to built using class-based exceptions.
6429
d0a5a78e6227 better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents: 6396
diff changeset
    58
70
73055652dd21 *** empty log message ***
claus
parents: 61
diff changeset
    59
    Signal and Exception provide a framework for exception handling.
44
b262907c93ea *** empty log message ***
claus
parents: 27
diff changeset
    60
70
73055652dd21 *** empty log message ***
claus
parents: 61
diff changeset
    61
    A Signal object is usually defined somewhere up in the calling chain
73055652dd21 *** empty log message ***
claus
parents: 61
diff changeset
    62
    and associated with some abnormal event. Many signals are also
73055652dd21 *** empty log message ***
claus
parents: 61
diff changeset
    63
    created at startup time and reused.
44
b262907c93ea *** empty log message ***
claus
parents: 27
diff changeset
    64
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
    65
    When the event is raised (by Signal>>raise) the control will be either
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
    66
    given to a debugger or - if a handler was defined - to the handler.
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
    67
    The handler will get a description of what (and where) happened in an
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
    68
    Exception object and can decide how to react on the situation (i.e.
120
9a2e74ed2f81 added per-process handler
claus
parents: 95
diff changeset
    69
    proceed, return or restart).
70
73055652dd21 *** empty log message ***
claus
parents: 61
diff changeset
    70
73055652dd21 *** empty log message ***
claus
parents: 61
diff changeset
    71
    There is also a companion class called SignalSet, which allows handling
73055652dd21 *** empty log message ***
claus
parents: 61
diff changeset
    72
    multiple signals with one handler (for example all arithmetic signals).
73055652dd21 *** empty log message ***
claus
parents: 61
diff changeset
    73
    And, finally there is a very special SignalSet which allows catching
73055652dd21 *** empty log message ***
claus
parents: 61
diff changeset
    74
    any signal (SignalSet>>anySignal).
73055652dd21 *** empty log message ***
claus
parents: 61
diff changeset
    75
171
129f0e2e23df handling now in Exception
claus
parents: 159
diff changeset
    76
    Since there is no official documentation on signal handling (i.e. none
129f0e2e23df handling now in Exception
claus
parents: 159
diff changeset
    77
    of the books describes it), this Signal implementation has been modeled
129f0e2e23df handling now in Exception
claus
parents: 159
diff changeset
    78
    after what some PD programs seem to expect and what alpha/beta testers told
129f0e2e23df handling now in Exception
claus
parents: 159
diff changeset
    79
    me it should look like.
129f0e2e23df handling now in Exception
claus
parents: 159
diff changeset
    80
    It may not be perfect and undergo minor changes.
44
b262907c93ea *** empty log message ***
claus
parents: 27
diff changeset
    81
120
9a2e74ed2f81 added per-process handler
claus
parents: 95
diff changeset
    82
    special:
9a2e74ed2f81 added per-process handler
claus
parents: 95
diff changeset
    83
70
73055652dd21 *** empty log message ***
claus
parents: 61
diff changeset
    84
    In addition to the nested catch & throw mechanism, signals can also be
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
    85
    used when no such handler scope exists. To support this, signals can be
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
    86
    assigned a handlerBlock, which gets evaluated with the exception as argument
120
9a2e74ed2f81 added per-process handler
claus
parents: 95
diff changeset
    87
    in case no handler was found (on the stack).
70
73055652dd21 *** empty log message ***
claus
parents: 61
diff changeset
    88
171
129f0e2e23df handling now in Exception
claus
parents: 159
diff changeset
    89
    If no handler was found (i.e. neither a handler context on the stack, nor
129f0e2e23df handling now in Exception
claus
parents: 159
diff changeset
    90
    a static handler block), the NoHandlerSignal will be raised instead,
120
9a2e74ed2f81 added per-process handler
claus
parents: 95
diff changeset
    91
    passing it the original exception in its exception-parameter.
171
129f0e2e23df handling now in Exception
claus
parents: 159
diff changeset
    92
    This NoHandlerSignal can be handled just like any other signal.
129f0e2e23df handling now in Exception
claus
parents: 159
diff changeset
    93
    (therefore, it is possible to catch any error by catching NoHandlerSignal.
70
73055652dd21 *** empty log message ***
claus
parents: 61
diff changeset
    94
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
    95
    When the NoHandler signal is raised, and neither a handler-context, nor
120
9a2e74ed2f81 added per-process handler
claus
parents: 95
diff changeset
    96
    a handler block is defined for it, an emergencyHandler(-block) is evaluated.
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
    97
    This block is either provided by the current process
120
9a2e74ed2f81 added per-process handler
claus
parents: 95
diff changeset
    98
    (see Process>>emergencySignalHandler) or as a global default by the Exception
9a2e74ed2f81 added per-process handler
claus
parents: 95
diff changeset
    99
    class (see Exception>>emergencyHandler).
9a2e74ed2f81 added per-process handler
claus
parents: 95
diff changeset
   100
    The default emergencyHandlerBlock (from Exception) will bring up a debugger.
9a2e74ed2f81 added per-process handler
claus
parents: 95
diff changeset
   101
21435
10e79ee6ff8e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 21046
diff changeset
   102
    HandlerBlocks allow a global (if it's the EmergencyHandler in Exception)
120
9a2e74ed2f81 added per-process handler
claus
parents: 95
diff changeset
   103
    or per-process signal handling to be added. Even to code which was never
9a2e74ed2f81 added per-process handler
claus
parents: 95
diff changeset
   104
    planned to handle signals.
70
73055652dd21 *** empty log message ***
claus
parents: 61
diff changeset
   105
171
129f0e2e23df handling now in Exception
claus
parents: 159
diff changeset
   106
    See samples in 'doc/coding' and actual raise code in Exception.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   107
1275
2079f4776628 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
   108
    [Instance variables:]
70
73055652dd21 *** empty log message ***
claus
parents: 61
diff changeset
   109
20091
386d81725b8f #OTHER by mawalch
mawalch
parents: 18726
diff changeset
   110
        mayProceed      <Boolean>       hint for the debugger - program may
386d81725b8f #OTHER by mawalch
mawalch
parents: 18726
diff changeset
   111
                                        proceed (currently not honored by the
386d81725b8f #OTHER by mawalch
mawalch
parents: 18726
diff changeset
   112
                                        debugger)
1275
2079f4776628 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
   113
20091
386d81725b8f #OTHER by mawalch
mawalch
parents: 18726
diff changeset
   114
        notifierString  <String>        error message to be output
70
73055652dd21 *** empty log message ***
claus
parents: 61
diff changeset
   115
20091
386d81725b8f #OTHER by mawalch
mawalch
parents: 18726
diff changeset
   116
        nameClass       <Class>         for the printOn-implementation; nameClass
386d81725b8f #OTHER by mawalch
mawalch
parents: 18726
diff changeset
   117
                                        is the class, to which message (below)
386d81725b8f #OTHER by mawalch
mawalch
parents: 18726
diff changeset
   118
                                        should be sent to create the receiver.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   119
20091
386d81725b8f #OTHER by mawalch
mawalch
parents: 18726
diff changeset
   120
        message         <Symbol>        for the printOn-implementation; message
386d81725b8f #OTHER by mawalch
mawalch
parents: 18726
diff changeset
   121
                                        is the selector, which should be sent to
386d81725b8f #OTHER by mawalch
mawalch
parents: 18726
diff changeset
   122
                                        nameClass (above) to create the receiver.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   123
20091
386d81725b8f #OTHER by mawalch
mawalch
parents: 18726
diff changeset
   124
        handlerBlock    <Block>         if nonNil, a 1-arg block to be
386d81725b8f #OTHER by mawalch
mawalch
parents: 18726
diff changeset
   125
                                        evaluated when no handler context is
386d81725b8f #OTHER by mawalch
mawalch
parents: 18726
diff changeset
   126
                                        found. The block gets the exception
386d81725b8f #OTHER by mawalch
mawalch
parents: 18726
diff changeset
   127
                                        object as argument. This will play the role
386d81725b8f #OTHER by mawalch
mawalch
parents: 18726
diff changeset
   128
                                        of an on-stack handler.
1275
2079f4776628 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
   129
1292
89497fff7f87 documentation
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   130
    [author:]
20091
386d81725b8f #OTHER by mawalch
mawalch
parents: 18726
diff changeset
   131
        Claus Gittinger
1292
89497fff7f87 documentation
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   132
1275
2079f4776628 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
   133
    [see also:]
20091
386d81725b8f #OTHER by mawalch
mawalch
parents: 18726
diff changeset
   134
        GenericException
386d81725b8f #OTHER by mawalch
mawalch
parents: 18726
diff changeset
   135
        SignalSet QuerySignal
386d81725b8f #OTHER by mawalch
mawalch
parents: 18726
diff changeset
   136
        Object
386d81725b8f #OTHER by mawalch
mawalch
parents: 18726
diff changeset
   137
        (``Exception handling and signals'': programming/exceptions.html)
44
b262907c93ea *** empty log message ***
claus
parents: 27
diff changeset
   138
"
b262907c93ea *** empty log message ***
claus
parents: 27
diff changeset
   139
! !
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   140
2207
ee6d4213b9df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1610
diff changeset
   141
!Signal class methodsFor:'instance creation'!
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   142
a27a279701f8 Initial revision
claus
parents:
diff changeset
   143
new
a27a279701f8 Initial revision
claus
parents:
diff changeset
   144
    "return a new signal"
a27a279701f8 Initial revision
claus
parents:
diff changeset
   145
4438
0b01443d07c1 Add proceedability stuff.
Stefan Vogel <sv@exept.de>
parents: 3521
diff changeset
   146
    ^ (self basicNew) notifierString:'signal'; mayProceed:true
3004
220af5090ec2 added the genericSignal for PP compatiblity
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
   147
220af5090ec2 added the genericSignal for PP compatiblity
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
   148
    "
220af5090ec2 added the genericSignal for PP compatiblity
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
   149
     Signal new
220af5090ec2 added the genericSignal for PP compatiblity
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
   150
    "
220af5090ec2 added the genericSignal for PP compatiblity
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
   151
220af5090ec2 added the genericSignal for PP compatiblity
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
   152
    "Modified: 8.10.1997 / 11:51:39 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   153
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
   154
2207
ee6d4213b9df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1610
diff changeset
   155
!Signal class methodsFor:'Signal constants'!
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   156
3004
220af5090ec2 added the genericSignal for PP compatiblity
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
   157
genericSignal
20427
0f3f9a156d0d #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20266
diff changeset
   158
    "return the generic signal - that's the parent of all signals
3004
220af5090ec2 added the genericSignal for PP compatiblity
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
   159
     in the system."
220af5090ec2 added the genericSignal for PP compatiblity
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
   160
4518
4716c8d7cb4c Implement NoHandlerException etc. as class based exceptions.
Stefan Vogel <sv@exept.de>
parents: 4513
diff changeset
   161
    ^ GenericException
3004
220af5090ec2 added the genericSignal for PP compatiblity
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
   162
4518
4716c8d7cb4c Implement NoHandlerException etc. as class based exceptions.
Stefan Vogel <sv@exept.de>
parents: 4513
diff changeset
   163
    "Created: / 8.10.1997 / 11:46:28 / cg"
4716c8d7cb4c Implement NoHandlerException etc. as class based exceptions.
Stefan Vogel <sv@exept.de>
parents: 4513
diff changeset
   164
    "Modified: / 8.10.1997 / 11:47:08 / cg"
4716c8d7cb4c Implement NoHandlerException etc. as class based exceptions.
Stefan Vogel <sv@exept.de>
parents: 4513
diff changeset
   165
    "Modified: / 4.8.1999 / 08:54:33 / stefan"
3004
220af5090ec2 added the genericSignal for PP compatiblity
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
   166
!
220af5090ec2 added the genericSignal for PP compatiblity
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
   167
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   168
noHandlerSignal
44
b262907c93ea *** empty log message ***
claus
parents: 27
diff changeset
   169
    "return the signal used to handle unhandled signals"
b262907c93ea *** empty log message ***
claus
parents: 27
diff changeset
   170
4527
2ddbe34bab87 Make error classes public.
Stefan Vogel <sv@exept.de>
parents: 4518
diff changeset
   171
    ^ NoHandlerError
4518
4716c8d7cb4c Implement NoHandlerException etc. as class based exceptions.
Stefan Vogel <sv@exept.de>
parents: 4513
diff changeset
   172
4716c8d7cb4c Implement NoHandlerException etc. as class based exceptions.
Stefan Vogel <sv@exept.de>
parents: 4513
diff changeset
   173
    "Modified: / 4.8.1999 / 08:10:09 / stefan"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   174
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
   175
15113
20b7764bc56a use #creator instead of #signal
Claus Gittinger <cg@exept.de>
parents: 14961
diff changeset
   176
!Signal methodsFor:'Compatibility-ANSI'!
20b7764bc56a use #creator instead of #signal
Claus Gittinger <cg@exept.de>
parents: 14961
diff changeset
   177
22797
094ff40472f3 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 22496
diff changeset
   178
signal
094ff40472f3 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 22496
diff changeset
   179
    "ANSI compatibility"
094ff40472f3 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 22496
diff changeset
   180
094ff40472f3 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 22496
diff changeset
   181
    self raiseSignal
094ff40472f3 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 22496
diff changeset
   182
!
094ff40472f3 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 22496
diff changeset
   183
15113
20b7764bc56a use #creator instead of #signal
Claus Gittinger <cg@exept.de>
parents: 14961
diff changeset
   184
signalWith:messageText
20b7764bc56a use #creator instead of #signal
Claus Gittinger <cg@exept.de>
parents: 14961
diff changeset
   185
    "ANSI compatibility"
20b7764bc56a use #creator instead of #signal
Claus Gittinger <cg@exept.de>
parents: 14961
diff changeset
   186
20b7764bc56a use #creator instead of #signal
Claus Gittinger <cg@exept.de>
parents: 14961
diff changeset
   187
    self raiseErrorString:messageText
20b7764bc56a use #creator instead of #signal
Claus Gittinger <cg@exept.de>
parents: 14961
diff changeset
   188
! !
20b7764bc56a use #creator instead of #signal
Claus Gittinger <cg@exept.de>
parents: 14961
diff changeset
   189
7261
f35fc9cee675 method category rename
Claus Gittinger <cg@exept.de>
parents: 7206
diff changeset
   190
!Signal methodsFor:'Compatibility-VW'!
5300
a66fa98a839a compatibility stuff: #new, #messageText: and #raiseSignal
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   191
a66fa98a839a compatibility stuff: #new, #messageText: and #raiseSignal
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   192
messageText:aString
a66fa98a839a compatibility stuff: #new, #messageText: and #raiseSignal
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   193
    ^ self notifierString:aString
a66fa98a839a compatibility stuff: #new, #messageText: and #raiseSignal
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   194
!
a66fa98a839a compatibility stuff: #new, #messageText: and #raiseSignal
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   195
a66fa98a839a compatibility stuff: #new, #messageText: and #raiseSignal
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   196
new
a66fa98a839a compatibility stuff: #new, #messageText: and #raiseSignal
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   197
    "create a new signal, using the receiver as a prototype and
a66fa98a839a compatibility stuff: #new, #messageText: and #raiseSignal
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   198
     setting the parent of the new signal to the receiver."
a66fa98a839a compatibility stuff: #new, #messageText: and #raiseSignal
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   199
a66fa98a839a compatibility stuff: #new, #messageText: and #raiseSignal
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   200
    ^ self newSignal
a66fa98a839a compatibility stuff: #new, #messageText: and #raiseSignal
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   201
! !
a66fa98a839a compatibility stuff: #new, #messageText: and #raiseSignal
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   202
23886
678caed54a3c #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 23308
diff changeset
   203
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   204
!Signal methodsFor:'accessing'!
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   205
15375
6beaee1cdc53 class: Signal
Claus Gittinger <cg@exept.de>
parents: 15239
diff changeset
   206
creator
16501
b324161af19b class: Signal
Claus Gittinger <cg@exept.de>
parents: 15375
diff changeset
   207
    "return the creator of the exception (for exception protocol compatibilty).
b324161af19b class: Signal
Claus Gittinger <cg@exept.de>
parents: 15375
diff changeset
   208
     For class based exceptions, that is the exception class;
18726
36732bc5400c class: Signal
Claus Gittinger <cg@exept.de>
parents: 16562
diff changeset
   209
     for signals, that is the signal itself.
36732bc5400c class: Signal
Claus Gittinger <cg@exept.de>
parents: 16562
diff changeset
   210
     This used to be called 'signal' in earlier versions,
36732bc5400c class: Signal
Claus Gittinger <cg@exept.de>
parents: 16562
diff changeset
   211
     but due to the conflict with VSE, Squeak and others, 
36732bc5400c class: Signal
Claus Gittinger <cg@exept.de>
parents: 16562
diff changeset
   212
     where 'signal' means 'raise', 'signal' was obsoleted by this method."
15375
6beaee1cdc53 class: Signal
Claus Gittinger <cg@exept.de>
parents: 15239
diff changeset
   213
6beaee1cdc53 class: Signal
Claus Gittinger <cg@exept.de>
parents: 15239
diff changeset
   214
    ^ self
6beaee1cdc53 class: Signal
Claus Gittinger <cg@exept.de>
parents: 15239
diff changeset
   215
!
6beaee1cdc53 class: Signal
Claus Gittinger <cg@exept.de>
parents: 15239
diff changeset
   216
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   217
errorString
7206
adcf244acd07 #errorSignal -> #description
Stefan Vogel <sv@exept.de>
parents: 6631
diff changeset
   218
    "errorString is deprecated, use description instead"
adcf244acd07 #errorSignal -> #description
Stefan Vogel <sv@exept.de>
parents: 6631
diff changeset
   219
adcf244acd07 #errorSignal -> #description
Stefan Vogel <sv@exept.de>
parents: 6631
diff changeset
   220
    <resource:#obsolete>
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   221
4563
a436888f8514 Add #description, #creator
Stefan Vogel <sv@exept.de>
parents: 4555
diff changeset
   222
    ^ self description
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   223
!
159
514c749165c3 *** empty log message ***
claus
parents: 145
diff changeset
   224
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   225
handlerBlock
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   226
    "return the handlerblock - if non-nil, this will be evaluated with the exception
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   227
     object as argument, if no #handle:do: context was found on the stack."
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   228
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   229
    ^ handlerBlock
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   230
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   231
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   232
handlerBlock:aOneArgBlock
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   233
    "set the handlerblock - this will be evaluated with the exception
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   234
     object as argument, if no #handle:do: context was found on the stack."
159
514c749165c3 *** empty log message ***
claus
parents: 145
diff changeset
   235
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   236
    handlerBlock := aOneArgBlock
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   237
!
159
514c749165c3 *** empty log message ***
claus
parents: 145
diff changeset
   238
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   239
mayProceed
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   240
    "return the signals ability to proceed.
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   241
     This flag is (currently) not checked by the system;
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   242
     be prepared for changes here, to eventually have nonProceedable
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   243
     signals refuse to let you continue execution."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   244
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   245
    ^ mayProceed
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   246
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   247
a27a279701f8 Initial revision
claus
parents:
diff changeset
   248
mayProceed:aBoolean
44
b262907c93ea *** empty log message ***
claus
parents: 27
diff changeset
   249
    "set/clear the signals ability to proceed.
419
62f39bdfe99d *** empty log message ***
claus
parents: 406
diff changeset
   250
     This flag is (currently) not checked by the system;
62f39bdfe99d *** empty log message ***
claus
parents: 406
diff changeset
   251
     be prepared for changes here, to eventually have nonProceedable
62f39bdfe99d *** empty log message ***
claus
parents: 406
diff changeset
   252
     signals refuse to let you continue execution."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   253
a27a279701f8 Initial revision
claus
parents:
diff changeset
   254
    mayProceed := aBoolean
a27a279701f8 Initial revision
claus
parents:
diff changeset
   255
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   256
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   257
nameClass:aClass message:aSelector
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   258
    "this sets the class & selector of a method which returns
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   259
     that signal - this is simply for documentation purposes -
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   260
     see Signal>>printOn: implementation.
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   261
     (took me a while to find that one out ;-)"
419
62f39bdfe99d *** empty log message ***
claus
parents: 406
diff changeset
   262
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   263
    nameClass := aClass.
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   264
    message := aSelector
419
62f39bdfe99d *** empty log message ***
claus
parents: 406
diff changeset
   265
!
62f39bdfe99d *** empty log message ***
claus
parents: 406
diff changeset
   266
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   267
notifierString
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   268
    "return the notifier string"
159
514c749165c3 *** empty log message ***
claus
parents: 145
diff changeset
   269
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   270
    ^ notifierString
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   271
!
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   272
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   273
notifierString:aString
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   274
    "set the notifier string"
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   275
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   276
    notifierString := aString
159
514c749165c3 *** empty log message ***
claus
parents: 145
diff changeset
   277
!
514c749165c3 *** empty log message ***
claus
parents: 145
diff changeset
   278
14961
671e322eec81 class: Signal
Claus Gittinger <cg@exept.de>
parents: 13010
diff changeset
   279
originalSignal
671e322eec81 class: Signal
Claus Gittinger <cg@exept.de>
parents: 13010
diff changeset
   280
    "return the signal/exception which was originally raised.
20427
0f3f9a156d0d #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20266
diff changeset
   281
     For noHandler, that is my unhandled signal; for others, that's the exception itself."
14961
671e322eec81 class: Signal
Claus Gittinger <cg@exept.de>
parents: 13010
diff changeset
   282
671e322eec81 class: Signal
Claus Gittinger <cg@exept.de>
parents: 13010
diff changeset
   283
    ^ self.
671e322eec81 class: Signal
Claus Gittinger <cg@exept.de>
parents: 13010
diff changeset
   284
!
671e322eec81 class: Signal
Claus Gittinger <cg@exept.de>
parents: 13010
diff changeset
   285
159
514c749165c3 *** empty log message ***
claus
parents: 145
diff changeset
   286
parent
514c749165c3 *** empty log message ***
claus
parents: 145
diff changeset
   287
    "return the parent-signal of the receiver"
514c749165c3 *** empty log message ***
claus
parents: 145
diff changeset
   288
514c749165c3 *** empty log message ***
claus
parents: 145
diff changeset
   289
    ^ parent
514c749165c3 *** empty log message ***
claus
parents: 145
diff changeset
   290
!
514c749165c3 *** empty log message ***
claus
parents: 145
diff changeset
   291
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   292
parent:aSignal
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   293
    "set the parent-signal of the receiver."
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   294
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   295
    parent := aSignal
3004
220af5090ec2 added the genericSignal for PP compatiblity
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
   296
!
220af5090ec2 added the genericSignal for PP compatiblity
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
   297
220af5090ec2 added the genericSignal for PP compatiblity
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
   298
parent:aSignal mayProceed:aBoolean
220af5090ec2 added the genericSignal for PP compatiblity
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
   299
    "set the parent-signal and the mayProceed flag of the receiver."
220af5090ec2 added the genericSignal for PP compatiblity
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
   300
3010
Claus Gittinger <cg@exept.de>
parents: 3008
diff changeset
   301
    parent := aSignal.
Claus Gittinger <cg@exept.de>
parents: 3008
diff changeset
   302
    mayProceed := aBoolean.
3004
220af5090ec2 added the genericSignal for PP compatiblity
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
   303
220af5090ec2 added the genericSignal for PP compatiblity
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
   304
    "Modified: 8.10.1997 / 11:56:11 / cg"
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   305
! !
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   306
5835
1db1b70603b6 Create SignalSets with #,
Stefan Vogel <sv@exept.de>
parents: 5697
diff changeset
   307
!Signal methodsFor:'converting'!
1db1b70603b6 Create SignalSets with #,
Stefan Vogel <sv@exept.de>
parents: 5697
diff changeset
   308
8239
23e8064adc69 comment
Stefan Vogel <sv@exept.de>
parents: 7722
diff changeset
   309
, anExceptionHandler
23e8064adc69 comment
Stefan Vogel <sv@exept.de>
parents: 7722
diff changeset
   310
    "return a SignalSet with myself and anExceptionHandler"
5835
1db1b70603b6 Create SignalSets with #,
Stefan Vogel <sv@exept.de>
parents: 5697
diff changeset
   311
8239
23e8064adc69 comment
Stefan Vogel <sv@exept.de>
parents: 7722
diff changeset
   312
    ^ SignalSet with:self with:anExceptionHandler
5835
1db1b70603b6 Create SignalSets with #,
Stefan Vogel <sv@exept.de>
parents: 5697
diff changeset
   313
! !
1db1b70603b6 Create SignalSets with #,
Stefan Vogel <sv@exept.de>
parents: 5697
diff changeset
   314
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   315
!Signal methodsFor:'copying'!
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   316
10953
4cb95f800e7e deepCopy change
ab
parents: 10776
diff changeset
   317
deepCopyUsing:aDictionary postCopySelector:postCopySelector
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   318
    "raise an error - deepCopy is not allowed for signals"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   319
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   320
    ^ self deepCopyError
3348
37b0481be091 must catch #deppCopyUsing: instead of #deepCopy.
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
   321
37b0481be091 must catch #deppCopyUsing: instead of #deepCopy.
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
   322
    "Created: / 31.3.1998 / 15:43:01 / cg"
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   323
! !
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   324
8681
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8384
diff changeset
   325
!Signal methodsFor:'exception creation'!
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8384
diff changeset
   326
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8384
diff changeset
   327
newException
8685
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   328
    "{ Pragma: +inlineNew }"
8681
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8384
diff changeset
   329
    "answer a new exception object for this signal.
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8384
diff changeset
   330
     Subclasses may redefine this method"
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8384
diff changeset
   331
21046
4aca308b3427 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 20953
diff changeset
   332
    |exception|
4aca308b3427 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 20953
diff changeset
   333
4aca308b3427 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 20953
diff changeset
   334
    parent notNil ifTrue:[
4aca308b3427 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 20953
diff changeset
   335
        "parent may be a class based signal"
4aca308b3427 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 20953
diff changeset
   336
        exception := parent newException.
4aca308b3427 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 20953
diff changeset
   337
    ] ifFalse:[
4aca308b3427 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 20953
diff changeset
   338
        exception := Exception basicNew.
4aca308b3427 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 20953
diff changeset
   339
    ].
4aca308b3427 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 20953
diff changeset
   340
        
4aca308b3427 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 20953
diff changeset
   341
    ^ exception creator:self
8681
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8384
diff changeset
   342
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8384
diff changeset
   343
    "Created: / 26.2.1998 / 19:53:56 / stefan"
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8384
diff changeset
   344
    "Modified: / 23.7.1999 / 13:41:00 / stefan"
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8384
diff changeset
   345
! !
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8384
diff changeset
   346
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   347
!Signal methodsFor:'instance creation'!
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   348
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   349
newSignal
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   350
    "create a new signal, using the receiver as a prototype and
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   351
     setting the parent of the new signal to the receiver."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   352
3010
Claus Gittinger <cg@exept.de>
parents: 3008
diff changeset
   353
    ^ (self copy) parent:self
3004
220af5090ec2 added the genericSignal for PP compatiblity
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
   354
220af5090ec2 added the genericSignal for PP compatiblity
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
   355
    "Modified: 8.10.1997 / 11:53:06 / cg"
70
73055652dd21 *** empty log message ***
claus
parents: 61
diff changeset
   356
!
73055652dd21 *** empty log message ***
claus
parents: 61
diff changeset
   357
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   358
newSignalMayProceed:aBoolean
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   359
    "create a new signal, using the receiver as a prototype and
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   360
     setting the parent of the new signal to the receiver."
362
claus
parents: 345
diff changeset
   361
3010
Claus Gittinger <cg@exept.de>
parents: 3008
diff changeset
   362
    ^ (self copy) parent:self mayProceed:aBoolean
70
73055652dd21 *** empty log message ***
claus
parents: 61
diff changeset
   363
3004
220af5090ec2 added the genericSignal for PP compatiblity
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
   364
    "Modified: 8.10.1997 / 11:57:13 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   365
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
   366
5570
e6e14f50d721 category change
Claus Gittinger <cg@exept.de>
parents: 5515
diff changeset
   367
!Signal methodsFor:'printing & storing'!
159
514c749165c3 *** empty log message ***
claus
parents: 145
diff changeset
   368
4563
a436888f8514 Add #description, #creator
Stefan Vogel <sv@exept.de>
parents: 4555
diff changeset
   369
description
a436888f8514 Add #description, #creator
Stefan Vogel <sv@exept.de>
parents: 4555
diff changeset
   370
    "return the notifier string.
a436888f8514 Add #description, #creator
Stefan Vogel <sv@exept.de>
parents: 4555
diff changeset
   371
     If the notifier string starts with space, prepend
a436888f8514 Add #description, #creator
Stefan Vogel <sv@exept.de>
parents: 4555
diff changeset
   372
     the parents notifier string"
a436888f8514 Add #description, #creator
Stefan Vogel <sv@exept.de>
parents: 4555
diff changeset
   373
6116
8c0d1f68d61a care for text-errorstring
Claus Gittinger <cg@exept.de>
parents: 5965
diff changeset
   374
    |s|
8c0d1f68d61a care for text-errorstring
Claus Gittinger <cg@exept.de>
parents: 5965
diff changeset
   375
4563
a436888f8514 Add #description, #creator
Stefan Vogel <sv@exept.de>
parents: 4555
diff changeset
   376
    notifierString isNil ifTrue:[
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   377
	^ parent description
5949
f261d27904f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5835
diff changeset
   378
    ].
6116
8c0d1f68d61a care for text-errorstring
Claus Gittinger <cg@exept.de>
parents: 5965
diff changeset
   379
    s := notifierString asString.
8c0d1f68d61a care for text-errorstring
Claus Gittinger <cg@exept.de>
parents: 5965
diff changeset
   380
    (s startsWith:Character space) ifTrue:[
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   381
	^ parent description, s
5949
f261d27904f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5835
diff changeset
   382
    ].
6116
8c0d1f68d61a care for text-errorstring
Claus Gittinger <cg@exept.de>
parents: 5965
diff changeset
   383
    ^ s
4563
a436888f8514 Add #description, #creator
Stefan Vogel <sv@exept.de>
parents: 4555
diff changeset
   384
a436888f8514 Add #description, #creator
Stefan Vogel <sv@exept.de>
parents: 4555
diff changeset
   385
    "
8292
c61c01e7d6e5 Use #description
Stefan Vogel <sv@exept.de>
parents: 8239
diff changeset
   386
     Error description
4563
a436888f8514 Add #description, #creator
Stefan Vogel <sv@exept.de>
parents: 4555
diff changeset
   387
    "
a436888f8514 Add #description, #creator
Stefan Vogel <sv@exept.de>
parents: 4555
diff changeset
   388
a436888f8514 Add #description, #creator
Stefan Vogel <sv@exept.de>
parents: 4555
diff changeset
   389
    "Modified: / 12.3.1998 / 15:04:41 / stefan"
a436888f8514 Add #description, #creator
Stefan Vogel <sv@exept.de>
parents: 4555
diff changeset
   390
!
a436888f8514 Add #description, #creator
Stefan Vogel <sv@exept.de>
parents: 4555
diff changeset
   391
14961
671e322eec81 class: Signal
Claus Gittinger <cg@exept.de>
parents: 13010
diff changeset
   392
descriptionForDebugger
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   393
    "return the description string of the signal which is used in the
14961
671e322eec81 class: Signal
Claus Gittinger <cg@exept.de>
parents: 13010
diff changeset
   394
     debugger title area"
671e322eec81 class: Signal
Claus Gittinger <cg@exept.de>
parents: 13010
diff changeset
   395
671e322eec81 class: Signal
Claus Gittinger <cg@exept.de>
parents: 13010
diff changeset
   396
    ^ self description.
671e322eec81 class: Signal
Claus Gittinger <cg@exept.de>
parents: 13010
diff changeset
   397
!
671e322eec81 class: Signal
Claus Gittinger <cg@exept.de>
parents: 13010
diff changeset
   398
159
514c749165c3 *** empty log message ***
claus
parents: 145
diff changeset
   399
printOn:aStream
514c749165c3 *** empty log message ***
claus
parents: 145
diff changeset
   400
    "append a printed representation of the receiver on aStream"
514c749165c3 *** empty log message ***
claus
parents: 145
diff changeset
   401
514c749165c3 *** empty log message ***
claus
parents: 145
diff changeset
   402
    nameClass notNil ifTrue:[
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   403
	nameClass isBehavior ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   404
	    aStream nextPutAll:nameClass name.
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   405
	] ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   406
	    nameClass printOn:aStream.
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   407
	].
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   408
	aStream space.
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   409
	aStream nextPutAll:message.
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   410
	^ self
159
514c749165c3 *** empty log message ***
claus
parents: 145
diff changeset
   411
    ].
514c749165c3 *** empty log message ***
claus
parents: 145
diff changeset
   412
    ^ super printOn:aStream
514c749165c3 *** empty log message ***
claus
parents: 145
diff changeset
   413
! !
514c749165c3 *** empty log message ***
claus
parents: 145
diff changeset
   414
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   415
!Signal methodsFor:'queries'!
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   416
23302
a5d66fd32992 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22797
diff changeset
   417
accepts:aSignalOrExceptionClass
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   418
    "return true, if the receiver accepts the argument, aSignal.
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   419
     (i.e. the receiver is aSignal or a parent of it). False otherwise."
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   420
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   421
    |s|
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   422
23302
a5d66fd32992 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22797
diff changeset
   423
    self == aSignalOrExceptionClass ifTrue:[^ true].
a5d66fd32992 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22797
diff changeset
   424
    "/ the following line depends on this method being redefined in QuerySignal
a5d66fd32992 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22797
diff changeset
   425
    aSignalOrExceptionClass isQuerySignal ifTrue:[^ false].
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   426
23302
a5d66fd32992 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22797
diff changeset
   427
    s := aSignalOrExceptionClass.
a5d66fd32992 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22797
diff changeset
   428
    [(s := s parent) notNil] whileTrue:[
a5d66fd32992 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22797
diff changeset
   429
        self == s ifTrue:[^ true].
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   430
    ].
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   431
    ^ false
4438
0b01443d07c1 Add proceedability stuff.
Stefan Vogel <sv@exept.de>
parents: 3521
diff changeset
   432
23302
a5d66fd32992 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22797
diff changeset
   433
    "Modified: / 22-03-1999 / 12:45:42 / stefan"
a5d66fd32992 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22797
diff changeset
   434
    "Modified (comment): / 28-08-2018 / 11:17:57 / Claus Gittinger"
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   435
!
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   436
10776
27ebdc435f1f +catchInDebugger
ca
parents: 9271
diff changeset
   437
catchInDebugger
27ebdc435f1f +catchInDebugger
ca
parents: 9271
diff changeset
   438
    "if set, the debugger will handle this signal in its event loop and will close itself
27ebdc435f1f +catchInDebugger
ca
parents: 9271
diff changeset
   439
     without asking for close-confirmation.
27ebdc435f1f +catchInDebugger
ca
parents: 9271
diff changeset
   440
     This allows for debugged processes to be terminated without a user confirmation dialog
27ebdc435f1f +catchInDebugger
ca
parents: 9271
diff changeset
   441
     (for now, this is used in expecco's hard-terminate function to shut down any open debuggers
27ebdc435f1f +catchInDebugger
ca
parents: 9271
diff changeset
   442
      together with the test-process)"
27ebdc435f1f +catchInDebugger
ca
parents: 9271
diff changeset
   443
27ebdc435f1f +catchInDebugger
ca
parents: 9271
diff changeset
   444
    ^ false
27ebdc435f1f +catchInDebugger
ca
parents: 9271
diff changeset
   445
!
27ebdc435f1f +catchInDebugger
ca
parents: 9271
diff changeset
   446
8681
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8384
diff changeset
   447
exceptionHandlerFor:anException in:aContext
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8384
diff changeset
   448
    "answer the exceptionHandler for anException from aContext."
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8384
diff changeset
   449
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8384
diff changeset
   450
    ^ self
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8384
diff changeset
   451
!
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8384
diff changeset
   452
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents: 4440
diff changeset
   453
handlerForSignal:signal context:theContext originator:originator
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents: 4440
diff changeset
   454
    "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: 4440
diff changeset
   455
     The block is retrieved from aContext.
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents: 4440
diff changeset
   456
     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: 4440
diff changeset
   457
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents: 4440
diff changeset
   458
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents: 4440
diff changeset
   459
    (theContext selector ~~ #'handle:from:do:'
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents: 4440
diff changeset
   460
     or:[(theContext argAt:2) == originator]) ifTrue:[
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   461
	(self == signal or:[self accepts:signal]) ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   462
	    ^ (theContext argAt:1) ? [nil]
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   463
	]
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents: 4440
diff changeset
   464
    ].
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents: 4440
diff changeset
   465
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents: 4440
diff changeset
   466
    ^ nil
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents: 4440
diff changeset
   467
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents: 4440
diff changeset
   468
    "Created: / 25.7.1999 / 19:55:43 / stefan"
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents: 4440
diff changeset
   469
!
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents: 4440
diff changeset
   470
4547
082a2f7d9d8e Add #handlerProtectedBlock:inContext
Stefan Vogel <sv@exept.de>
parents: 4540
diff changeset
   471
handlerProtectedBlock:doBlock inContext:context
082a2f7d9d8e Add #handlerProtectedBlock:inContext
Stefan Vogel <sv@exept.de>
parents: 4540
diff changeset
   472
    "set the handlerProtectedBlock in context"
082a2f7d9d8e Add #handlerProtectedBlock:inContext
Stefan Vogel <sv@exept.de>
parents: 4540
diff changeset
   473
082a2f7d9d8e Add #handlerProtectedBlock:inContext
Stefan Vogel <sv@exept.de>
parents: 4540
diff changeset
   474
    context selector == #handle:do: ifTrue:[
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   475
	context argAt:2 put:doBlock.
4547
082a2f7d9d8e Add #handlerProtectedBlock:inContext
Stefan Vogel <sv@exept.de>
parents: 4540
diff changeset
   476
    ] ifFalse:[context selector == #handle:from:do: ifTrue:[
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   477
	context argAt:3 put:doBlock.
4547
082a2f7d9d8e Add #handlerProtectedBlock:inContext
Stefan Vogel <sv@exept.de>
parents: 4540
diff changeset
   478
    ]].
082a2f7d9d8e Add #handlerProtectedBlock:inContext
Stefan Vogel <sv@exept.de>
parents: 4540
diff changeset
   479
082a2f7d9d8e Add #handlerProtectedBlock:inContext
Stefan Vogel <sv@exept.de>
parents: 4540
diff changeset
   480
082a2f7d9d8e Add #handlerProtectedBlock:inContext
Stefan Vogel <sv@exept.de>
parents: 4540
diff changeset
   481
082a2f7d9d8e Add #handlerProtectedBlock:inContext
Stefan Vogel <sv@exept.de>
parents: 4540
diff changeset
   482
!
082a2f7d9d8e Add #handlerProtectedBlock:inContext
Stefan Vogel <sv@exept.de>
parents: 4540
diff changeset
   483
8681
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8384
diff changeset
   484
handles:anException
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8384
diff changeset
   485
    "return true, if the receiver handles the argument, anException.
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8384
diff changeset
   486
     (i.e. the receiver is anExceptions signal or a parent of it)"
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8384
diff changeset
   487
23308
53631bb11cd1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 23302
diff changeset
   488
    ^ self accepts:(anException creator)
53631bb11cd1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 23302
diff changeset
   489
"/    |signal|
53631bb11cd1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 23302
diff changeset
   490
"/
53631bb11cd1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 23302
diff changeset
   491
"/    signal := anException creator.
53631bb11cd1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 23302
diff changeset
   492
"/
53631bb11cd1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 23302
diff changeset
   493
"/    self == signal ifTrue:[^ true].               "quick check"
53631bb11cd1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 23302
diff changeset
   494
"/    anException isNotification ifTrue:[^ false].  "speed up queries by not traversing the parent chain"
53631bb11cd1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 23302
diff changeset
   495
"/
53631bb11cd1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 23302
diff changeset
   496
"/    [(signal := signal parent) notNil] whileTrue:[
53631bb11cd1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 23302
diff changeset
   497
"/        self == signal ifTrue:[^ true].
53631bb11cd1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 23302
diff changeset
   498
"/    ].
53631bb11cd1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 23302
diff changeset
   499
"/    ^ false
4473
793078981f01 added #handlingSignalInContext:
Claus Gittinger <cg@exept.de>
parents: 4466
diff changeset
   500
23308
53631bb11cd1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 23302
diff changeset
   501
    "Modified: / 28-08-2018 / 11:32:23 / Claus Gittinger"
4473
793078981f01 added #handlingSignalInContext:
Claus Gittinger <cg@exept.de>
parents: 4466
diff changeset
   502
!
793078981f01 added #handlingSignalInContext:
Claus Gittinger <cg@exept.de>
parents: 4466
diff changeset
   503
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   504
inheritsFrom:anotherSignal
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   505
    "return true, if the receiver is a child of anotherSignal
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   506
     (i.e. if handling anotherSignal also handles the receiver)
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   507
     This is almost the same as accepts, but returns false, if
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   508
     the receiver is identical to anotherSignal."
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   509
9271
6be3fa0ab53d inheritsFrom: should not be used/redefined in the exception
Claus Gittinger <cg@exept.de>
parents: 9180
diff changeset
   510
    <resource: #obsolete>
6be3fa0ab53d inheritsFrom: should not be used/redefined in the exception
Claus Gittinger <cg@exept.de>
parents: 9180
diff changeset
   511
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   512
    self == anotherSignal ifTrue:[^ false].
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   513
    ^ anotherSignal accepts:self
3521
4d83701cfc28 care for nil receiver in #isHandledIn:
Claus Gittinger <cg@exept.de>
parents: 3348
diff changeset
   514
4d83701cfc28 care for nil receiver in #isHandledIn:
Claus Gittinger <cg@exept.de>
parents: 3348
diff changeset
   515
    "Modified: / 6.6.1998 / 20:37:47 / cg"
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   516
!
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   517
23302
a5d66fd32992 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22797
diff changeset
   518
isAcceptedBy:aHandlerSignalOrHandlerExceptionClass
a5d66fd32992 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22797
diff changeset
   519
    "return true, if the aHandlerSignalOrHandlerExceptionClass accepts the receiver."
a5d66fd32992 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22797
diff changeset
   520
a5d66fd32992 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22797
diff changeset
   521
    ^ aHandlerSignalOrHandlerExceptionClass accepts:self
a5d66fd32992 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22797
diff changeset
   522
a5d66fd32992 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22797
diff changeset
   523
    "Created: / 28-08-2018 / 10:54:35 / Claus Gittinger"
a5d66fd32992 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22797
diff changeset
   524
!
a5d66fd32992 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22797
diff changeset
   525
6200
65f0631e5221 added #isControlInterrupt
Claus Gittinger <cg@exept.de>
parents: 6116
diff changeset
   526
isControlInterrupt
65f0631e5221 added #isControlInterrupt
Claus Gittinger <cg@exept.de>
parents: 6116
diff changeset
   527
    ^ false
65f0631e5221 added #isControlInterrupt
Claus Gittinger <cg@exept.de>
parents: 6116
diff changeset
   528
65f0631e5221 added #isControlInterrupt
Claus Gittinger <cg@exept.de>
parents: 6116
diff changeset
   529
    "Created: / 16.11.2001 / 16:12:20 / cg"
65f0631e5221 added #isControlInterrupt
Claus Gittinger <cg@exept.de>
parents: 6116
diff changeset
   530
!
65f0631e5221 added #isControlInterrupt
Claus Gittinger <cg@exept.de>
parents: 6116
diff changeset
   531
6631
5ffa1ce7b2cc #isExceptionCreator instead of #isSignal
Stefan Vogel <sv@exept.de>
parents: 6518
diff changeset
   532
isExceptionCreator
5ffa1ce7b2cc #isExceptionCreator instead of #isSignal
Stefan Vogel <sv@exept.de>
parents: 6518
diff changeset
   533
    "return true, if the receiver can create exceptions,
5ffa1ce7b2cc #isExceptionCreator instead of #isSignal
Stefan Vogel <sv@exept.de>
parents: 6518
diff changeset
   534
     this includes #raise, #raiseRequest as well as the behavior of
5ffa1ce7b2cc #isExceptionCreator instead of #isSignal
Stefan Vogel <sv@exept.de>
parents: 6518
diff changeset
   535
     an exception handler, such as the #accepts: and #handles: messages"
5ffa1ce7b2cc #isExceptionCreator instead of #isSignal
Stefan Vogel <sv@exept.de>
parents: 6518
diff changeset
   536
5ffa1ce7b2cc #isExceptionCreator instead of #isSignal
Stefan Vogel <sv@exept.de>
parents: 6518
diff changeset
   537
    ^ true
5ffa1ce7b2cc #isExceptionCreator instead of #isSignal
Stefan Vogel <sv@exept.de>
parents: 6518
diff changeset
   538
!
5ffa1ce7b2cc #isExceptionCreator instead of #isSignal
Stefan Vogel <sv@exept.de>
parents: 6518
diff changeset
   539
5ffa1ce7b2cc #isExceptionCreator instead of #isSignal
Stefan Vogel <sv@exept.de>
parents: 6518
diff changeset
   540
isExceptionHandler
5ffa1ce7b2cc #isExceptionCreator instead of #isSignal
Stefan Vogel <sv@exept.de>
parents: 6518
diff changeset
   541
    "return true, if the receiver responds to the exception handler protocol,
5ffa1ce7b2cc #isExceptionCreator instead of #isSignal
Stefan Vogel <sv@exept.de>
parents: 6518
diff changeset
   542
     especially to the #accepts: and #handles: messages"
5ffa1ce7b2cc #isExceptionCreator instead of #isSignal
Stefan Vogel <sv@exept.de>
parents: 6518
diff changeset
   543
5ffa1ce7b2cc #isExceptionCreator instead of #isSignal
Stefan Vogel <sv@exept.de>
parents: 6518
diff changeset
   544
    ^ true
5ffa1ce7b2cc #isExceptionCreator instead of #isSignal
Stefan Vogel <sv@exept.de>
parents: 6518
diff changeset
   545
!
5ffa1ce7b2cc #isExceptionCreator instead of #isSignal
Stefan Vogel <sv@exept.de>
parents: 6518
diff changeset
   546
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   547
isHandled
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   548
    "return true, if there is a handler for the receiver signal.
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   549
     Raising an unhandled signal will usually lead into the debugger,
2689
ada9b102abcf typo fix
Claus Gittinger <cg@exept.de>
parents: 2497
diff changeset
   550
     but can be caught globally by setting Exceptions EmergencyHandler."
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   551
4676
5d469e2da40a common code for isHandled
Claus Gittinger <cg@exept.de>
parents: 4622
diff changeset
   552
    ^ GenericException exception:self isHandledIn:(thisContext sender).
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   553
!
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   554
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   555
isHandledIn:aContext
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   556
    "return true, if there is a handler for the receiver signal in the
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   557
     contextChain starting with aContext."
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   558
4676
5d469e2da40a common code for isHandled
Claus Gittinger <cg@exept.de>
parents: 4622
diff changeset
   559
    ^ GenericException exception:self isHandledIn:aContext
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   560
!
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   561
22066
20e0fa5d209c #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 21855
diff changeset
   562
isQuery
20e0fa5d209c #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 21855
diff changeset
   563
    "return true, if this is a query"
20e0fa5d209c #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 21855
diff changeset
   564
20e0fa5d209c #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 21855
diff changeset
   565
    ^ false
20e0fa5d209c #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 21855
diff changeset
   566
20e0fa5d209c #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 21855
diff changeset
   567
    "Created: / 21-07-2017 / 00:44:48 / cg"
20e0fa5d209c #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 21855
diff changeset
   568
!
20e0fa5d209c #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 21855
diff changeset
   569
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   570
isQuerySignal
1249
2d5d0edd3359 commentary
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
   571
    "return true, if this is a querySignal - always return false here"
2d5d0edd3359 commentary
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
   572
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   573
    ^ false
1249
2d5d0edd3359 commentary
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
   574
2d5d0edd3359 commentary
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
   575
    "Modified: 22.4.1996 / 13:45:06 / cg"
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   576
! !
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   577
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   578
!Signal methodsFor:'raising'!
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   579
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   580
raise
4438
0b01443d07c1 Add proceedability stuff.
Stefan Vogel <sv@exept.de>
parents: 3521
diff changeset
   581
    "raise a signal nonproceedable.
8685
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   582
     The signals notifierString is used as messageText."
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   583
4555
892c4529acf2 cleaned up suspendedContext passing.
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
   584
    <context: #return>
892c4529acf2 cleaned up suspendedContext passing.
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
   585
13010
4c17135a1e8f changed setup
Claus Gittinger <cg@exept.de>
parents: 12062
diff changeset
   586
    ^ self newException
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   587
	raiseIn:thisContext sender
1326
60ea3687ee49 commentary
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
   588
13010
4c17135a1e8f changed setup
Claus Gittinger <cg@exept.de>
parents: 12062
diff changeset
   589
    "Created: / 23-07-1999 / 14:07:17 / stefan"
4c17135a1e8f changed setup
Claus Gittinger <cg@exept.de>
parents: 12062
diff changeset
   590
    "Modified: / 10-08-2010 / 09:58:57 / cg"
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   591
!
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   592
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   593
raiseErrorString:aString
1326
60ea3687ee49 commentary
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
   594
    "raise a signal nonproceedable.
8685
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   595
     The argument is used as messageText."
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   596
4555
892c4529acf2 cleaned up suspendedContext passing.
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
   597
    <context: #return>
892c4529acf2 cleaned up suspendedContext passing.
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
   598
13010
4c17135a1e8f changed setup
Claus Gittinger <cg@exept.de>
parents: 12062
diff changeset
   599
    ^ self newException
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   600
	raiseErrorString:aString in:thisContext sender
1326
60ea3687ee49 commentary
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
   601
13010
4c17135a1e8f changed setup
Claus Gittinger <cg@exept.de>
parents: 12062
diff changeset
   602
    "Created: / 23-07-1999 / 14:07:33 / stefan"
4c17135a1e8f changed setup
Claus Gittinger <cg@exept.de>
parents: 12062
diff changeset
   603
    "Modified: / 10-08-2010 / 09:59:22 / cg"
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   604
!
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   605
5685
b7fe093174aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5570
diff changeset
   606
raiseErrorString:aString in:aContext
b7fe093174aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5570
diff changeset
   607
    "raise a signal nonproceedable.
8685
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   608
     The argument is used as messageText."
5685
b7fe093174aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5570
diff changeset
   609
b7fe093174aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5570
diff changeset
   610
    <context: #return>
b7fe093174aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5570
diff changeset
   611
13010
4c17135a1e8f changed setup
Claus Gittinger <cg@exept.de>
parents: 12062
diff changeset
   612
    ^ self newException
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   613
	raiseErrorString:aString in:aContext
5685
b7fe093174aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5570
diff changeset
   614
13010
4c17135a1e8f changed setup
Claus Gittinger <cg@exept.de>
parents: 12062
diff changeset
   615
    "Created: / 23-07-1999 / 14:07:33 / stefan"
4c17135a1e8f changed setup
Claus Gittinger <cg@exept.de>
parents: 12062
diff changeset
   616
    "Modified: / 10-08-2010 / 09:59:58 / cg"
5685
b7fe093174aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5570
diff changeset
   617
!
b7fe093174aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5570
diff changeset
   618
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   619
raiseFrom:something
1326
60ea3687ee49 commentary
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
   620
    "raise a signal nonproceedable.
4438
0b01443d07c1 Add proceedability stuff.
Stefan Vogel <sv@exept.de>
parents: 3521
diff changeset
   621
     The argument, something is passed both as parameter and originator."
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   622
4555
892c4529acf2 cleaned up suspendedContext passing.
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
   623
    <context: #return>
892c4529acf2 cleaned up suspendedContext passing.
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
   624
8730
9d369e8854e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8685
diff changeset
   625
    ^ (self newException
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   626
	    suspendedContext:(thisContext sender) parameter:something originator:something)
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   627
	raise
1326
60ea3687ee49 commentary
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
   628
13010
4c17135a1e8f changed setup
Claus Gittinger <cg@exept.de>
parents: 12062
diff changeset
   629
    "Created: / 23-07-1999 / 14:07:59 / stefan"
4c17135a1e8f changed setup
Claus Gittinger <cg@exept.de>
parents: 12062
diff changeset
   630
    "Modified: / 10-08-2010 / 09:58:36 / cg"
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   631
!
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   632
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   633
raiseRequest
1326
60ea3687ee49 commentary
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
   634
    "raise a signal proceedable.
8685
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   635
     The signals notifierString is used as messageText."
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   636
4555
892c4529acf2 cleaned up suspendedContext passing.
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
   637
    <context: #return>
892c4529acf2 cleaned up suspendedContext passing.
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
   638
13010
4c17135a1e8f changed setup
Claus Gittinger <cg@exept.de>
parents: 12062
diff changeset
   639
    ^ self newException
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   640
	raiseRequestIn:thisContext sender
1326
60ea3687ee49 commentary
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
   641
13010
4c17135a1e8f changed setup
Claus Gittinger <cg@exept.de>
parents: 12062
diff changeset
   642
    "Created: / 23-07-1999 / 14:08:24 / stefan"
4c17135a1e8f changed setup
Claus Gittinger <cg@exept.de>
parents: 12062
diff changeset
   643
    "Modified: / 10-08-2010 / 10:00:13 / cg"
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   644
!
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   645
4759
99d883e67ec9 added #raiseRequestErrorString
Claus Gittinger <cg@exept.de>
parents: 4676
diff changeset
   646
raiseRequestErrorString:aString
99d883e67ec9 added #raiseRequestErrorString
Claus Gittinger <cg@exept.de>
parents: 4676
diff changeset
   647
    "raise a signal proceedable.
8685
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   648
     The argument, aString is used as messageText."
4759
99d883e67ec9 added #raiseRequestErrorString
Claus Gittinger <cg@exept.de>
parents: 4676
diff changeset
   649
99d883e67ec9 added #raiseRequestErrorString
Claus Gittinger <cg@exept.de>
parents: 4676
diff changeset
   650
    <context: #return>
99d883e67ec9 added #raiseRequestErrorString
Claus Gittinger <cg@exept.de>
parents: 4676
diff changeset
   651
13010
4c17135a1e8f changed setup
Claus Gittinger <cg@exept.de>
parents: 12062
diff changeset
   652
    ^ self newException
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   653
	raiseRequestErrorString:aString in:thisContext sender
13010
4c17135a1e8f changed setup
Claus Gittinger <cg@exept.de>
parents: 12062
diff changeset
   654
4c17135a1e8f changed setup
Claus Gittinger <cg@exept.de>
parents: 12062
diff changeset
   655
    "Modified: / 10-08-2010 / 10:00:40 / cg"
8685
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   656
!
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   657
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   658
raiseRequestFrom:something
8685
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   659
    "raise a signal proceedable.
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   660
     The argument, something is passed both as parameter and originator."
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   661
8685
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   662
    <context: #return>
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   663
8730
9d369e8854e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8685
diff changeset
   664
    ^ (self newException
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   665
	suspendedContext:(thisContext sender) parameter:something originator:something)
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   666
	raiseRequest
8685
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   667
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   668
    "Modified: / 2.5.1996 / 16:36:38 / cg"
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   669
    "Modified: / 5.3.1998 / 16:52:46 / stefan"
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   670
    "Created: / 23.7.1999 / 14:08:36 / stefan"
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   671
!
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   672
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   673
raiseRequestWith:aParameter
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   674
    "raise a signal proceedable.
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   675
     The signals notifierString is used as messageText."
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   676
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   677
    <context: #return>
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   678
13010
4c17135a1e8f changed setup
Claus Gittinger <cg@exept.de>
parents: 12062
diff changeset
   679
    ^ self newException
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   680
	raiseRequestWith:aParameter in:thisContext sender
8685
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   681
13010
4c17135a1e8f changed setup
Claus Gittinger <cg@exept.de>
parents: 12062
diff changeset
   682
    "Created: / 23-07-1999 / 14:08:48 / stefan"
4c17135a1e8f changed setup
Claus Gittinger <cg@exept.de>
parents: 12062
diff changeset
   683
    "Modified: / 10-08-2010 / 10:01:00 / cg"
8685
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   684
!
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   685
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   686
raiseRequestWith:aParameter errorString:aString
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   687
    "raise a signal proceedable.
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   688
     The argument, aString is used as messageText."
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   689
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   690
    <context: #return>
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   691
13010
4c17135a1e8f changed setup
Claus Gittinger <cg@exept.de>
parents: 12062
diff changeset
   692
    ^ self newException
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   693
	raiseRequestWith:aParameter errorString:aString in:thisContext sender
4759
99d883e67ec9 added #raiseRequestErrorString
Claus Gittinger <cg@exept.de>
parents: 4676
diff changeset
   694
13010
4c17135a1e8f changed setup
Claus Gittinger <cg@exept.de>
parents: 12062
diff changeset
   695
    "Created: / 23-07-1999 / 14:08:57 / stefan"
4c17135a1e8f changed setup
Claus Gittinger <cg@exept.de>
parents: 12062
diff changeset
   696
    "Modified: / 10-08-2010 / 10:01:38 / cg"
4759
99d883e67ec9 added #raiseRequestErrorString
Claus Gittinger <cg@exept.de>
parents: 4676
diff changeset
   697
!
99d883e67ec9 added #raiseRequestErrorString
Claus Gittinger <cg@exept.de>
parents: 4676
diff changeset
   698
8685
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   699
raiseRequestWith:aParameter errorString:aString in:aContext
3103
a53892ec3492 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3010
diff changeset
   700
    "raise a signal proceedable.
8685
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   701
     The argument, aString is used as messageText.
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   702
     The additional context is passed as the context responsible for the raise,
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   703
     allowing a raise to mimicri the exception happened somewhere else."
4555
892c4529acf2 cleaned up suspendedContext passing.
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
   704
8732
8807a0254968 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8730
diff changeset
   705
    <context: #return>
8807a0254968 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8730
diff changeset
   706
13010
4c17135a1e8f changed setup
Claus Gittinger <cg@exept.de>
parents: 12062
diff changeset
   707
    ^ self newException
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   708
	raiseRequestWith:aParameter errorString:aString in:aContext
3103
a53892ec3492 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3010
diff changeset
   709
13010
4c17135a1e8f changed setup
Claus Gittinger <cg@exept.de>
parents: 12062
diff changeset
   710
    "Created: / 23-07-1999 / 14:09:07 / stefan"
4c17135a1e8f changed setup
Claus Gittinger <cg@exept.de>
parents: 12062
diff changeset
   711
    "Modified: / 10-08-2010 / 10:02:08 / cg"
3103
a53892ec3492 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3010
diff changeset
   712
!
a53892ec3492 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3010
diff changeset
   713
8685
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   714
raiseRequestWith:aParameter in:aContext
1326
60ea3687ee49 commentary
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
   715
    "raise a signal proceedable.
8685
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   716
     The additional context is passed as the context responsible for the raise,
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   717
     allowing a raise to mimicri the exception happened somewhere else."
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   718
8732
8807a0254968 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8730
diff changeset
   719
    <context: #return>
8807a0254968 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8730
diff changeset
   720
13010
4c17135a1e8f changed setup
Claus Gittinger <cg@exept.de>
parents: 12062
diff changeset
   721
    ^ self newException
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   722
	raiseRequestWith:aParameter in:aContext
13010
4c17135a1e8f changed setup
Claus Gittinger <cg@exept.de>
parents: 12062
diff changeset
   723
4c17135a1e8f changed setup
Claus Gittinger <cg@exept.de>
parents: 12062
diff changeset
   724
    "Modified: / 10-08-2010 / 10:02:26 / cg"
8685
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   725
!
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   726
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   727
raiseSignal
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   728
    "raise a signal (proceedable or not, whatever the proceedability is).
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   729
     The signals notifierString is used as messageText."
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   730
4555
892c4529acf2 cleaned up suspendedContext passing.
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
   731
    <context: #return>
892c4529acf2 cleaned up suspendedContext passing.
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
   732
8730
9d369e8854e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8685
diff changeset
   733
    ^ (self newException
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   734
	suspendedContext:thisContext sender)
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   735
	raiseSignal
1326
60ea3687ee49 commentary
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
   736
8685
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   737
    "Modified: / 10.11.2001 / 15:13:34 / cg"
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   738
!
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   739
8685
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   740
raiseSignal:errorMessage
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   741
    "ANSI: raise a signal (proceedable or not, whatever the proceedability is).
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   742
     The argument, errorMessage is used as messageText."
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   743
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   744
    <context: #return>
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   745
8730
9d369e8854e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8685
diff changeset
   746
    ^ (self newException
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   747
	suspendedContext:(thisContext sender) errorString:errorMessage)
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   748
	raiseSignal.
8685
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   749
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   750
    "Modified: / 07-08-2004 / 19:24:00 / stefan"
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   751
!
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   752
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   753
raiseSignal:errorMessage with:aParameter
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   754
    "ANSI: raise a signal (proceedable or not, whatever the proceedability is).
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   755
     The argument, errorMessage is used as messageText."
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   756
4555
892c4529acf2 cleaned up suspendedContext passing.
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
   757
    <context: #return>
892c4529acf2 cleaned up suspendedContext passing.
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
   758
8730
9d369e8854e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8685
diff changeset
   759
    ^ (self newException
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   760
	suspendedContext:(thisContext sender) parameter:aParameter errorString:errorMessage)
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   761
	raiseSignal.
8685
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   762
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   763
    "Modified: / 07-08-2004 / 19:10:40 / stefan"
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   764
!
1326
60ea3687ee49 commentary
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
   765
8685
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   766
raiseSignalErrorString:aString
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   767
    "raise a signal (proceedable or not, whatever the proceedability is).
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   768
     The argument, aString is used as messageText."
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   769
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   770
    <context: #return>
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   771
8730
9d369e8854e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8685
diff changeset
   772
    ^ (self newException
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   773
	suspendedContext:(thisContext sender) errorString:aString)
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   774
	raiseSignal.
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   775
!
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   776
8685
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   777
raiseSignalWith:aParameter
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   778
    "raise a signal (proceedable or not, whatever the proceedability is).
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   779
     The argument, aParameter is passed as parameter."
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   780
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   781
    <context: #return>
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   782
8730
9d369e8854e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8685
diff changeset
   783
    ^ (self newException
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   784
	suspendedContext:(thisContext sender) parameter:aParameter)
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   785
	raiseSignal.
8685
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   786
!
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   787
8685
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   788
raiseSignalWith:aParameter errorString:aString
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   789
    "raise a signal (proceedable or not, whatever the proceedability is).
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   790
     The argument, aString is used as messageText,
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   791
     aParameter is passed as exception parameter."
1326
60ea3687ee49 commentary
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
   792
8685
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   793
    <context: #return>
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   794
8730
9d369e8854e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8685
diff changeset
   795
    ^ (self newException
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   796
	suspendedContext:(thisContext sender) parameter:aParameter errorString:aString)
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   797
	raiseSignal.
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   798
!
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   799
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   800
raiseWith:aParameter
1326
60ea3687ee49 commentary
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
   801
    "raise a signal nonproceedable.
4438
0b01443d07c1 Add proceedability stuff.
Stefan Vogel <sv@exept.de>
parents: 3521
diff changeset
   802
     The argument, aParameter is passed as parameter."
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   803
4555
892c4529acf2 cleaned up suspendedContext passing.
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
   804
    <context: #return>
892c4529acf2 cleaned up suspendedContext passing.
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
   805
13010
4c17135a1e8f changed setup
Claus Gittinger <cg@exept.de>
parents: 12062
diff changeset
   806
    ^ self newException
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   807
	raiseWith:aParameter in:thisContext sender
1326
60ea3687ee49 commentary
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
   808
13010
4c17135a1e8f changed setup
Claus Gittinger <cg@exept.de>
parents: 12062
diff changeset
   809
    "Created: / 23-07-1999 / 14:09:27 / stefan"
4c17135a1e8f changed setup
Claus Gittinger <cg@exept.de>
parents: 12062
diff changeset
   810
    "Modified: / 10-08-2010 / 10:02:51 / cg"
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   811
!
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   812
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   813
raiseWith:aParameter errorString:aString
4438
0b01443d07c1 Add proceedability stuff.
Stefan Vogel <sv@exept.de>
parents: 3521
diff changeset
   814
    "raise a signal nonproceedable.
8685
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   815
     The argument, aString is used as messageText,
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   816
     aParameter is passed as exception parameter."
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   817
4555
892c4529acf2 cleaned up suspendedContext passing.
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
   818
    <context: #return>
892c4529acf2 cleaned up suspendedContext passing.
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
   819
13010
4c17135a1e8f changed setup
Claus Gittinger <cg@exept.de>
parents: 12062
diff changeset
   820
    ^ self newException
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   821
	raiseWith:aParameter errorString:aString in:thisContext sender
1326
60ea3687ee49 commentary
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
   822
13010
4c17135a1e8f changed setup
Claus Gittinger <cg@exept.de>
parents: 12062
diff changeset
   823
    "Created: / 23-07-1999 / 14:09:36 / stefan"
4c17135a1e8f changed setup
Claus Gittinger <cg@exept.de>
parents: 12062
diff changeset
   824
    "Modified: / 10-08-2010 / 10:03:29 / cg"
1326
60ea3687ee49 commentary
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
   825
!
60ea3687ee49 commentary
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
   826
60ea3687ee49 commentary
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
   827
raiseWith:aParameter errorString:aString in:aContext
4438
0b01443d07c1 Add proceedability stuff.
Stefan Vogel <sv@exept.de>
parents: 3521
diff changeset
   828
    "raise a signal nonproceedable.
8685
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   829
     The argument, aString is used as messageText, aParameter is passed
1608
440faca45e37 comment
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   830
     as exception parameter.
440faca45e37 comment
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   831
     The additional context is passed as the context responsible for the raise,
440faca45e37 comment
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   832
     allowing a raise to mimicri the exception happened somewhere else."
440faca45e37 comment
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   833
8732
8807a0254968 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8730
diff changeset
   834
    <context: #return>
8807a0254968 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8730
diff changeset
   835
13010
4c17135a1e8f changed setup
Claus Gittinger <cg@exept.de>
parents: 12062
diff changeset
   836
    ^ self newException
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   837
	raiseWith:aParameter errorString:aString in:aContext
1326
60ea3687ee49 commentary
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
   838
13010
4c17135a1e8f changed setup
Claus Gittinger <cg@exept.de>
parents: 12062
diff changeset
   839
    "Created: / 23-07-1999 / 14:09:46 / stefan"
4c17135a1e8f changed setup
Claus Gittinger <cg@exept.de>
parents: 12062
diff changeset
   840
    "Modified: / 10-08-2010 / 10:03:19 / cg"
8685
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   841
!
06c1d82512f5 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   842
9180
1bdb32899dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9079
diff changeset
   843
raiseWith:aParameter in:aContext
1bdb32899dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9079
diff changeset
   844
    "raise a signal nonproceedable.
1bdb32899dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9079
diff changeset
   845
     The argument, aParameter is passed as parameter.
1bdb32899dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9079
diff changeset
   846
     The additional context is passed as the context responsible for the raise,
1bdb32899dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9079
diff changeset
   847
     allowing a raise to mimicri the exception happened somewhere else."
1bdb32899dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9079
diff changeset
   848
1bdb32899dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9079
diff changeset
   849
    <context: #return>
1bdb32899dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9079
diff changeset
   850
13010
4c17135a1e8f changed setup
Claus Gittinger <cg@exept.de>
parents: 12062
diff changeset
   851
    ^ self newException
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   852
	raiseWith:aParameter in:aContext
13010
4c17135a1e8f changed setup
Claus Gittinger <cg@exept.de>
parents: 12062
diff changeset
   853
4c17135a1e8f changed setup
Claus Gittinger <cg@exept.de>
parents: 12062
diff changeset
   854
    "Modified: / 10-08-2010 / 10:03:05 / cg"
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   855
! !
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   856
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   857
!Signal methodsFor:'save evaluation'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   858
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   859
catch:aBlock
6396
74d5b0b588a6 added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents: 6200
diff changeset
   860
    "evaluate the argument, aBlock.
74d5b0b588a6 added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents: 6200
diff changeset
   861
     If the receiver-signal is raised during evaluation, abort
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   862
     the evaluation and return true; otherwise return false.
6396
74d5b0b588a6 added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents: 6200
diff changeset
   863
     This is the catch & throw mechanism found in other languages,
20266
db7ad9651afb #OTHER by mawalch
mawalch
parents: 20091
diff changeset
   864
     where the returned value indicates if an exception occurred."
6396
74d5b0b588a6 added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents: 6200
diff changeset
   865
9079
1d9020d87c86 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8732
diff changeset
   866
    |raiseOccurred|
6396
74d5b0b588a6 added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents: 6200
diff changeset
   867
9079
1d9020d87c86 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8732
diff changeset
   868
    raiseOccurred := false.
1d9020d87c86 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8732
diff changeset
   869
    self handle:[:ex | raiseOccurred := true. ex return] do:aBlock.
1d9020d87c86 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8732
diff changeset
   870
    ^ raiseOccurred
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   871
9079
1d9020d87c86 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8732
diff changeset
   872
    "
1d9020d87c86 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8732
diff changeset
   873
     Object messageNotUnderstoodSignal catch:[
20266
db7ad9651afb #OTHER by mawalch
mawalch
parents: 20091
diff changeset
   874
        123 size open
9079
1d9020d87c86 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8732
diff changeset
   875
     ]
1d9020d87c86 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8732
diff changeset
   876
    "
6396
74d5b0b588a6 added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents: 6200
diff changeset
   877
!
74d5b0b588a6 added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents: 6200
diff changeset
   878
74d5b0b588a6 added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents: 6200
diff changeset
   879
deferAfter:aBlock
12006
a86008133c3e comment(s) in deferAfter:
Claus Gittinger <cg@exept.de>
parents: 12005
diff changeset
   880
    " evaluate the argument, aBlock.
6396
74d5b0b588a6 added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents: 6200
diff changeset
   881
     Ignore the receiver-signal during evaluation - i.e. simply continue,
74d5b0b588a6 added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents: 6200
diff changeset
   882
     but remember if the signal was raised.
74d5b0b588a6 added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents: 6200
diff changeset
   883
     After the block evaluation, finally raise the signal - if it was raised in the block.
74d5b0b588a6 added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents: 6200
diff changeset
   884
     If the signal is raised multiple times, only the first raises parameter is remembered,
23886
678caed54a3c #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 23308
diff changeset
   885
     and only a single raise is performed after the block's evaluation.
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   886
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   887
     Deferring makes sense for some signals, such as UserInterrupt or AbortSignal,
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   888
     which must occasionally be delayed temporarily until a save place is reached
20820
01811b77f67f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20427
diff changeset
   889
     (especially when packages are sent across a communication channel, and you don't want
6396
74d5b0b588a6 added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents: 6200
diff changeset
   890
      partial packages to be generated by user interruptions)."
74d5b0b588a6 added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents: 6200
diff changeset
   891
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   892
    |caughtException result|
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   893
6396
74d5b0b588a6 added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents: 6200
diff changeset
   894
    self handle:[:ex |
20820
01811b77f67f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20427
diff changeset
   895
        caughtException isNil ifTrue:[
01811b77f67f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20427
diff changeset
   896
            caughtException := ex.
01811b77f67f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20427
diff changeset
   897
        ].
01811b77f67f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20427
diff changeset
   898
        ex proceedWith:nil
6396
74d5b0b588a6 added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents: 6200
diff changeset
   899
    ] do:[
20820
01811b77f67f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20427
diff changeset
   900
        result := aBlock value.
6396
74d5b0b588a6 added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents: 6200
diff changeset
   901
    ].
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   902
    caughtException notNil ifTrue:[
20820
01811b77f67f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20427
diff changeset
   903
        caughtException suspendedContext:thisContext.
6429
d0a5a78e6227 better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents: 6396
diff changeset
   904
20820
01811b77f67f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20427
diff changeset
   905
        "/ the signal was raised during the execution of aBlock above.
01811b77f67f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20427
diff changeset
   906
        "/ Raise it now (delayed).
01811b77f67f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20427
diff changeset
   907
        caughtException raiseSignal
6396
74d5b0b588a6 added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents: 6200
diff changeset
   908
    ].
74d5b0b588a6 added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents: 6200
diff changeset
   909
    ^ result
74d5b0b588a6 added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents: 6200
diff changeset
   910
74d5b0b588a6 added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents: 6200
diff changeset
   911
     "
6429
d0a5a78e6227 better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents: 6396
diff changeset
   912
      |s|
d0a5a78e6227 better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents: 6396
diff changeset
   913
d0a5a78e6227 better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents: 6396
diff changeset
   914
      s := Signal new mayProceed:true.
d0a5a78e6227 better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents: 6396
diff changeset
   915
      s deferAfter:[
20820
01811b77f67f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20427
diff changeset
   916
         s raiseRequestWith:'hello' errorString:'eeee'
6396
74d5b0b588a6 added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents: 6200
diff changeset
   917
      ]
74d5b0b588a6 added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents: 6200
diff changeset
   918
     "
23886
678caed54a3c #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 23308
diff changeset
   919
678caed54a3c #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 23308
diff changeset
   920
    "Modified (comment): / 13-03-2019 / 10:28:08 / Claus Gittinger"
622
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   921
!
a17084b7ac06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   922
12062
Claus Gittinger <cg@exept.de>
parents: 12006
diff changeset
   923
evaluate:aBlock ifRaised:exceptionValue
Claus Gittinger <cg@exept.de>
parents: 12006
diff changeset
   924
    "evaluate the argument, aBlock and return its value.
Claus Gittinger <cg@exept.de>
parents: 12006
diff changeset
   925
     If the receiver-signal is raised during evaluation, abort
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   926
     the evaluation and return the value from exceptionValue.
12062
Claus Gittinger <cg@exept.de>
parents: 12006
diff changeset
   927
     This is similar to the catch & throw mechanism found in other languages"
Claus Gittinger <cg@exept.de>
parents: 12006
diff changeset
   928
22496
0bfdeef77a63 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 22066
diff changeset
   929
    ^ self handle:exceptionValue do:aBlock.
12062
Claus Gittinger <cg@exept.de>
parents: 12006
diff changeset
   930
Claus Gittinger <cg@exept.de>
parents: 12006
diff changeset
   931
    "
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   932
     Object messageNotUnderstoodSignal
22496
0bfdeef77a63 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 22066
diff changeset
   933
        evaluate:[ 123 size open ]
0bfdeef77a63 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 22066
diff changeset
   934
        ifRaised:[ self halt ]
12062
Claus Gittinger <cg@exept.de>
parents: 12006
diff changeset
   935
    "
22496
0bfdeef77a63 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 22066
diff changeset
   936
0bfdeef77a63 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 22066
diff changeset
   937
    "Modified: / 12-01-2018 / 17:46:55 / stefan"
12062
Claus Gittinger <cg@exept.de>
parents: 12006
diff changeset
   938
!
Claus Gittinger <cg@exept.de>
parents: 12006
diff changeset
   939
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   940
handle:handleBlock do:aBlock
a27a279701f8 Initial revision
claus
parents:
diff changeset
   941
    "evaluate the argument, aBlock.
a27a279701f8 Initial revision
claus
parents:
diff changeset
   942
     If the receiver-signal is raised during evaluation,
a27a279701f8 Initial revision
claus
parents:
diff changeset
   943
     evaluate the handleBlock passing it an Exception argument.
a27a279701f8 Initial revision
claus
parents:
diff changeset
   944
     The handler may decide how to react to the signal by sending
a27a279701f8 Initial revision
claus
parents:
diff changeset
   945
     a corresponding message to the exception (see there).
a27a279701f8 Initial revision
claus
parents:
diff changeset
   946
     If the signal is not raised, return the value of evaluating
a27a279701f8 Initial revision
claus
parents:
diff changeset
   947
     aBlock."
a27a279701f8 Initial revision
claus
parents:
diff changeset
   948
4547
082a2f7d9d8e Add #handlerProtectedBlock:inContext
Stefan Vogel <sv@exept.de>
parents: 4540
diff changeset
   949
    <context: #return>
4491
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4486
diff changeset
   950
    <exception: #handle>
95
d22739a0c6e9 *** empty log message ***
claus
parents: 88
diff changeset
   951
4491
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4486
diff changeset
   952
    "/ thisContext markForHandle. -- same as above pragma
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4486
diff changeset
   953
    ^ aBlock value  "the real logic is in Exception>>doRaise"
120
9a2e74ed2f81 added per-process handler
claus
parents: 95
diff changeset
   954
4491
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4486
diff changeset
   955
    "
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4486
diff changeset
   956
     Object messageNotUnderstoodSignal handle:[:ex |
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   957
	'oops' printNL.
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   958
	ex return
4491
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4486
diff changeset
   959
     ] do:[
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   960
	123 size open
4491
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4486
diff changeset
   961
     ]
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4486
diff changeset
   962
    "
95
d22739a0c6e9 *** empty log message ***
claus
parents: 88
diff changeset
   963
4491
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4486
diff changeset
   964
    "
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4486
diff changeset
   965
     |num|
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4486
diff changeset
   966
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4486
diff changeset
   967
     num := 0.
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4486
diff changeset
   968
     Number divisionByZeroSignal handle:[:ex |
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   969
	'oops' printNL.
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   970
	ex return
4491
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4486
diff changeset
   971
     ] do:[
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
   972
	123 / num
4491
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4486
diff changeset
   973
     ]
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4486
diff changeset
   974
    "
4438
0b01443d07c1 Add proceedability stuff.
Stefan Vogel <sv@exept.de>
parents: 3521
diff changeset
   975
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents: 4440
diff changeset
   976
    "Modified: / 25.7.1999 / 19:43:01 / stefan"
44
b262907c93ea *** empty log message ***
claus
parents: 27
diff changeset
   977
!
b262907c93ea *** empty log message ***
claus
parents: 27
diff changeset
   978
362
claus
parents: 345
diff changeset
   979
handle:handleBlock from:anObject do:aBlock
claus
parents: 345
diff changeset
   980
    "evaluate the argument, aBlock.
claus
parents: 345
diff changeset
   981
     If the receiver-signal is raised during evaluation,
claus
parents: 345
diff changeset
   982
     and the exception originated from anObject,
claus
parents: 345
diff changeset
   983
     evaluate the handleBlock passing it an Exception argument.
claus
parents: 345
diff changeset
   984
     The handler may decide how to react to the signal by sending
claus
parents: 345
diff changeset
   985
     a corresponding message to the exception (see there).
claus
parents: 345
diff changeset
   986
     If the signal is not raised, return the value of evaluating
claus
parents: 345
diff changeset
   987
     aBlock."
claus
parents: 345
diff changeset
   988
4547
082a2f7d9d8e Add #handlerProtectedBlock:inContext
Stefan Vogel <sv@exept.de>
parents: 4540
diff changeset
   989
    <context: #return>
4491
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4486
diff changeset
   990
    <exception: #handle>
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4486
diff changeset
   991
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4486
diff changeset
   992
    "/ thisContext markForHandle. -- same as above pragma
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4486
diff changeset
   993
    ^ aBlock value  "the real logic is in Exception>>doRaise"
362
claus
parents: 345
diff changeset
   994
4491
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4486
diff changeset
   995
    "
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4486
diff changeset
   996
     the first open will be caught; the second not:
362
claus
parents: 345
diff changeset
   997
4491
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4486
diff changeset
   998
     |o1 o2|
362
claus
parents: 345
diff changeset
   999
4491
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4486
diff changeset
  1000
     o1 := 123.
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4486
diff changeset
  1001
     o2 := nil.
16562
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
  1002
     Object messageNotUnderstoodSignal
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
  1003
	 handle:
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
  1004
	      [:ex |
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
  1005
		  'oops' printNL.
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
  1006
		  ex proceed
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
  1007
	      ]
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
  1008
	 from:o1
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
  1009
	 do:
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
  1010
	      [
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
  1011
		  o1 open.
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
  1012
		  o2 open
Claus Gittinger <cg@exept.de>
parents: 16501
diff changeset
  1013
	      ]
4491
5041cae5651c use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents: 4486
diff changeset
  1014
    "
4438
0b01443d07c1 Add proceedability stuff.
Stefan Vogel <sv@exept.de>
parents: 3521
diff changeset
  1015
4464
cec93c942c14 Use context flag for exception handling instead of searching for
Stefan Vogel <sv@exept.de>
parents: 4440
diff changeset
  1016
    "Modified: / 25.7.1999 / 19:43:40 / stefan"
362
claus
parents: 345
diff changeset
  1017
!
claus
parents: 345
diff changeset
  1018
419
62f39bdfe99d *** empty log message ***
claus
parents: 406
diff changeset
  1019
ignoreIn:aBlock
6396
74d5b0b588a6 added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents: 6200
diff changeset
  1020
    "evaluate the argument, aBlock.
21855
01676c1d34a1 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 21565
diff changeset
  1021
     Ignore the receiver-signal during evaluation - i.e. simply continue with the default resume value.
6396
74d5b0b588a6 added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents: 6200
diff changeset
  1022
     This makes only sense for some signals, such as UserInterrupt
21565
26083269801c #DOCUMENTATION by stefan
Stefan Vogel <sv@exept.de>
parents: 21435
diff changeset
  1023
     or AbortOperationRequest, because continuing after an exception without any cleanup
6396
74d5b0b588a6 added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents: 6200
diff changeset
  1024
     often leads to followup-errors."
159
514c749165c3 *** empty log message ***
claus
parents: 145
diff changeset
  1025
21855
01676c1d34a1 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 21565
diff changeset
  1026
     ^ self handle:[:ex | ex proceed] do:aBlock.
159
514c749165c3 *** empty log message ***
claus
parents: 145
diff changeset
  1027
6396
74d5b0b588a6 added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents: 6200
diff changeset
  1028
     "
74d5b0b588a6 added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents: 6200
diff changeset
  1029
      Object messageNotUnderstoodSignal ignoreIn:[
21565
26083269801c #DOCUMENTATION by stefan
Stefan Vogel <sv@exept.de>
parents: 21435
diff changeset
  1030
         123 size open
6396
74d5b0b588a6 added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents: 6200
diff changeset
  1031
      ]
74d5b0b588a6 added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents: 6200
diff changeset
  1032
     "
21565
26083269801c #DOCUMENTATION by stefan
Stefan Vogel <sv@exept.de>
parents: 21435
diff changeset
  1033
26083269801c #DOCUMENTATION by stefan
Stefan Vogel <sv@exept.de>
parents: 21435
diff changeset
  1034
    "Modified (comment): / 24-02-2017 / 11:15:55 / stefan"
21855
01676c1d34a1 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 21565
diff changeset
  1035
    "Modified (comment): / 20-06-2017 / 13:35:10 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1036
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1037
2207
ee6d4213b9df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1610
diff changeset
  1038
!Signal class methodsFor:'documentation'!
1249
2d5d0edd3359 commentary
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  1039
2d5d0edd3359 commentary
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  1040
version
18726
36732bc5400c class: Signal
Claus Gittinger <cg@exept.de>
parents: 16562
diff changeset
  1041
    ^ '$Header$'
12062
Claus Gittinger <cg@exept.de>
parents: 12006
diff changeset
  1042
!
Claus Gittinger <cg@exept.de>
parents: 12006
diff changeset
  1043
Claus Gittinger <cg@exept.de>
parents: 12006
diff changeset
  1044
version_CVS
18726
36732bc5400c class: Signal
Claus Gittinger <cg@exept.de>
parents: 16562
diff changeset
  1045
    ^ '$Header$'
1249
2d5d0edd3359 commentary
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  1046
! !
18726
36732bc5400c class: Signal
Claus Gittinger <cg@exept.de>
parents: 16562
diff changeset
  1047