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