1
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1993 by Claus Gittinger
|
159
|
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 |
"
|
|
12 |
|
|
13 |
Object subclass:#Signal
|
159
|
14 |
instanceVariableNames:'mayProceed notifierString nameClass message
|
|
15 |
handlerBlock parent'
|
171
|
16 |
classVariableNames:'NoHandlerSignal'
|
159
|
17 |
poolDictionaries:''
|
|
18 |
category:'Kernel-Exceptions'
|
1
|
19 |
!
|
|
20 |
|
|
21 |
Signal comment:'
|
|
22 |
COPYRIGHT (c) 1993 by Claus Gittinger
|
159
|
23 |
All Rights Reserved
|
95
|
24 |
|
406
|
25 |
$Header: /cvs/stx/stx/libbasic/Signal.st,v 1.26 1995-08-23 17:50:18 claus Exp $
|
44
|
26 |
'!
|
|
27 |
|
|
28 |
!Signal class methodsFor:'documentation'!
|
|
29 |
|
88
|
30 |
copyright
|
|
31 |
"
|
|
32 |
COPYRIGHT (c) 1993 by Claus Gittinger
|
159
|
33 |
All Rights Reserved
|
88
|
34 |
|
|
35 |
This software is furnished under a license and may be used
|
|
36 |
only in accordance with the terms of that license and with the
|
|
37 |
inclusion of the above copyright notice. This software may not
|
|
38 |
be provided or otherwise made available to, or used by, any
|
|
39 |
other person. No title to or ownership of the software is
|
|
40 |
hereby transferred.
|
|
41 |
"
|
|
42 |
!
|
|
43 |
|
|
44 |
version
|
|
45 |
"
|
406
|
46 |
$Header: /cvs/stx/stx/libbasic/Signal.st,v 1.26 1995-08-23 17:50:18 claus Exp $
|
88
|
47 |
"
|
|
48 |
!
|
|
49 |
|
44
|
50 |
documentation
|
|
51 |
"
|
70
|
52 |
Signal and Exception provide a framework for exception handling.
|
44
|
53 |
|
70
|
54 |
A Signal object is usually defined somewhere up in the calling chain
|
|
55 |
and associated with some abnormal event. Many signals are also
|
|
56 |
created at startup time and reused.
|
44
|
57 |
|
70
|
58 |
When the event is raised (by Signal>>raise) the control will be either
|
|
59 |
given to a debugger or - if a handler was defined - to the handler.
|
|
60 |
The handler will get a description of what (and where) happened in an
|
120
|
61 |
Exception object and can decide how to react on the situation (i.e.
|
|
62 |
proceed, return or restart).
|
70
|
63 |
|
|
64 |
There is also a companion class called SignalSet, which allows handling
|
|
65 |
multiple signals with one handler (for example all arithmetic signals).
|
|
66 |
And, finally there is a very special SignalSet which allows catching
|
|
67 |
any signal (SignalSet>>anySignal).
|
|
68 |
|
171
|
69 |
Since there is no official documentation on signal handling (i.e. none
|
|
70 |
of the books describes it), this Signal implementation has been modeled
|
|
71 |
after what some PD programs seem to expect and what alpha/beta testers told
|
|
72 |
me it should look like.
|
|
73 |
It may not be perfect and undergo minor changes.
|
44
|
74 |
|
120
|
75 |
special:
|
|
76 |
|
70
|
77 |
In addition to the nested catch & throw mechanism, signals can also be
|
120
|
78 |
used when no such handler scope exists. To support this, signals can be
|
|
79 |
assigned a handlerBlock, which gets evaluated with the exception as argument
|
|
80 |
in case no handler was found (on the stack).
|
70
|
81 |
|
171
|
82 |
If no handler was found (i.e. neither a handler context on the stack, nor
|
|
83 |
a static handler block), the NoHandlerSignal will be raised instead,
|
120
|
84 |
passing it the original exception in its exception-parameter.
|
171
|
85 |
This NoHandlerSignal can be handled just like any other signal.
|
|
86 |
(therefore, it is possible to catch any error by catching NoHandlerSignal.
|
70
|
87 |
|
120
|
88 |
When the NoHandler signal is raised, and neither a handler-context, nor
|
|
89 |
a handler block is defined for it, an emergencyHandler(-block) is evaluated.
|
|
90 |
This block is either provided by the current process
|
|
91 |
(see Process>>emergencySignalHandler) or as a global default by the Exception
|
|
92 |
class (see Exception>>emergencyHandler).
|
|
93 |
The default emergencyHandlerBlock (from Exception) will bring up a debugger.
|
|
94 |
|
|
95 |
HandlerBlocks allow a global (if its the EmergencyHandler in Exception)
|
|
96 |
or per-process signal handling to be added. Even to code which was never
|
|
97 |
planned to handle signals.
|
70
|
98 |
|
171
|
99 |
See samples in 'doc/coding' and actual raise code in Exception.
|
1
|
100 |
|
70
|
101 |
Instance variables:
|
|
102 |
|
159
|
103 |
mayProceed <Boolean> hint for the debugger - program may
|
|
104 |
proceed (currently not honored by the
|
|
105 |
debugger)
|
70
|
106 |
|
171
|
107 |
notifierString <String> error message to be output
|
1
|
108 |
|
171
|
109 |
nameClass <Class> for the printOn-implementation; nameClass
|
|
110 |
is the class, to which message (below)
|
|
111 |
should be sent to create the receiver.
|
1
|
112 |
|
171
|
113 |
message <Symbol> for the printOn-implementation; message
|
|
114 |
is the selector, which should be sent to
|
|
115 |
nameClass (above) to create the receiver.
|
70
|
116 |
|
159
|
117 |
handlerBlock <Block> if nonNil, a 1-arg block to be
|
|
118 |
evaluated when no handler context is
|
|
119 |
found. The block gets the exception
|
171
|
120 |
object as argument. This will play the role
|
|
121 |
of an on-stack handler.
|
|
122 |
|
|
123 |
Class variables:
|
120
|
124 |
|
171
|
125 |
NoHandlerSignal <Signal> signal raised when no handler for a signal
|
|
126 |
was found in raise.
|
|
127 |
If this one is not handled either,
|
|
128 |
Exceptions emergencyHandler will be evaluated
|
|
129 |
instead (or a per-proces handler, if there
|
|
130 |
is one).
|
44
|
131 |
"
|
|
132 |
! !
|
1
|
133 |
|
|
134 |
!Signal class methodsFor:'initialization'!
|
|
135 |
|
159
|
136 |
initialize
|
44
|
137 |
"setup the signal used to handle unhandled signals"
|
|
138 |
|
61
|
139 |
NoHandlerSignal isNil ifTrue:[
|
302
|
140 |
NoHandlerSignal := ErrorSignal newSignalMayProceed:true.
|
159
|
141 |
NoHandlerSignal nameClass:self message:#noHandlerSignal.
|
|
142 |
NoHandlerSignal notifierString:'unhandled exception'.
|
61
|
143 |
]
|
1
|
144 |
! !
|
|
145 |
|
|
146 |
!Signal class methodsFor:'instance creation'!
|
|
147 |
|
|
148 |
new
|
|
149 |
"return a new signal"
|
|
150 |
|
|
151 |
^ self basicNew notifierString:'signal'
|
|
152 |
! !
|
|
153 |
|
345
|
154 |
!Signal class methodsFor:'Signal constants'!
|
1
|
155 |
|
|
156 |
noHandlerSignal
|
44
|
157 |
"return the signal used to handle unhandled signals"
|
|
158 |
|
1
|
159 |
^ NoHandlerSignal
|
|
160 |
! !
|
|
161 |
|
|
162 |
!Signal methodsFor:'instance creation'!
|
|
163 |
|
|
164 |
newSignalMayProceed:aBoolean
|
159
|
165 |
"create a new signal, using the receiver as a prototype and
|
|
166 |
setting the parent of the new signal to the receiver."
|
1
|
167 |
|
159
|
168 |
|newSignal|
|
|
169 |
|
|
170 |
newSignal := (self copy) mayProceed:aBoolean.
|
|
171 |
newSignal parent:self.
|
|
172 |
^ newSignal
|
1
|
173 |
!
|
|
174 |
|
|
175 |
newSignal
|
159
|
176 |
"create a new signal, using the receiver as a prototype and
|
|
177 |
setting the parent of the new signal to the receiver."
|
|
178 |
|
|
179 |
^ (self copy) parent:self
|
|
180 |
! !
|
1
|
181 |
|
159
|
182 |
!Signal methodsFor:'copying'!
|
|
183 |
|
|
184 |
deepCopy
|
|
185 |
"raise an error - deepCopy is not allowed for signals"
|
|
186 |
|
|
187 |
^ self deepCopyError
|
1
|
188 |
! !
|
|
189 |
|
|
190 |
!Signal methodsFor:'accessing'!
|
|
191 |
|
|
192 |
nameClass:aClass message:aSelector
|
159
|
193 |
"this sets the class & selector of a method which returns
|
|
194 |
that signal - this is simply for documentation purposes -
|
|
195 |
see Signal>>printOn: implementation.
|
|
196 |
(took me a while to find that one out ;-)"
|
1
|
197 |
|
|
198 |
nameClass := aClass.
|
|
199 |
message := aSelector
|
|
200 |
!
|
|
201 |
|
|
202 |
mayProceed:aBoolean
|
44
|
203 |
"set/clear the signals ability to proceed.
|
|
204 |
This flag is not checked in the current version of
|
|
205 |
the debugger."
|
1
|
206 |
|
|
207 |
mayProceed := aBoolean
|
|
208 |
!
|
|
209 |
|
159
|
210 |
parent:aSignal
|
|
211 |
"set the parent-signal of the receiver."
|
|
212 |
|
|
213 |
parent := aSignal
|
|
214 |
!
|
|
215 |
|
|
216 |
parent
|
|
217 |
"return the parent-signal of the receiver"
|
|
218 |
|
|
219 |
^ parent
|
|
220 |
!
|
|
221 |
|
1
|
222 |
notifierString:aString
|
|
223 |
"set the notifier string"
|
|
224 |
|
|
225 |
notifierString := aString
|
|
226 |
!
|
|
227 |
|
|
228 |
notifierString
|
|
229 |
"return the notifier string"
|
|
230 |
|
|
231 |
^ notifierString
|
70
|
232 |
!
|
|
233 |
|
362
|
234 |
errorString
|
|
235 |
"return the notifier string"
|
|
236 |
|
|
237 |
^ notifierString
|
|
238 |
!
|
|
239 |
|
120
|
240 |
handlerBlock:aOneArgBlock
|
|
241 |
"set the handlerblock - this will be evaluated with the exception
|
|
242 |
object as argument, if no #handle:do: context was found on the stack."
|
70
|
243 |
|
120
|
244 |
handlerBlock := aOneArgBlock
|
171
|
245 |
!
|
|
246 |
|
|
247 |
handlerBlock
|
|
248 |
"return the handlerblock - if non-nil, this will be evaluated with the exception
|
|
249 |
object as argument, if no #handle:do: context was found on the stack."
|
|
250 |
|
|
251 |
^ handlerBlock
|
1
|
252 |
! !
|
|
253 |
|
159
|
254 |
!Signal methodsFor:'printing'!
|
|
255 |
|
|
256 |
printOn:aStream
|
|
257 |
"append a printed representation of the receiver on aStream"
|
|
258 |
|
|
259 |
nameClass notNil ifTrue:[
|
|
260 |
aStream nextPutAll:nameClass name.
|
|
261 |
aStream space.
|
|
262 |
aStream nextPutAll:message.
|
|
263 |
^ self
|
|
264 |
].
|
|
265 |
^ super printOn:aStream
|
|
266 |
! !
|
|
267 |
|
1
|
268 |
!Signal methodsFor:'save evaluation'!
|
|
269 |
|
|
270 |
handle:handleBlock do:aBlock
|
|
271 |
"evaluate the argument, aBlock.
|
|
272 |
If the receiver-signal is raised during evaluation,
|
|
273 |
evaluate the handleBlock passing it an Exception argument.
|
|
274 |
The handler may decide how to react to the signal by sending
|
|
275 |
a corresponding message to the exception (see there).
|
|
276 |
If the signal is not raised, return the value of evaluating
|
|
277 |
aBlock."
|
|
278 |
|
|
279 |
^ aBlock value "the real logic is in raise/Exception"
|
95
|
280 |
|
|
281 |
"
|
|
282 |
Object messageNotUnderstoodSignal handle:[:ex |
|
159
|
283 |
'oops' printNL.
|
|
284 |
ex return
|
95
|
285 |
] do:[
|
159
|
286 |
123 size open
|
95
|
287 |
]
|
|
288 |
"
|
120
|
289 |
|
95
|
290 |
"
|
|
291 |
|num|
|
|
292 |
|
|
293 |
num := 0.
|
|
294 |
Number divisionByZeroSignal handle:[:ex |
|
159
|
295 |
'oops' printNL.
|
|
296 |
ex return
|
95
|
297 |
] do:[
|
159
|
298 |
123 / num
|
95
|
299 |
]
|
|
300 |
"
|
44
|
301 |
!
|
|
302 |
|
362
|
303 |
handle:handleBlock from:anObject do:aBlock
|
|
304 |
"evaluate the argument, aBlock.
|
|
305 |
If the receiver-signal is raised during evaluation,
|
|
306 |
and the exception originated from anObject,
|
|
307 |
evaluate the handleBlock passing it an Exception argument.
|
|
308 |
The handler may decide how to react to the signal by sending
|
|
309 |
a corresponding message to the exception (see there).
|
|
310 |
If the signal is not raised, return the value of evaluating
|
|
311 |
aBlock."
|
|
312 |
|
|
313 |
^ aBlock value "the real logic is in raise/Exception"
|
|
314 |
|
|
315 |
"
|
|
316 |
the first open will be cought; the second not:
|
|
317 |
|
|
318 |
|o1 o2|
|
|
319 |
|
|
320 |
o1 := 123.
|
|
321 |
o2 := nil.
|
|
322 |
Object messageNotUnderstoodSignal
|
|
323 |
handle:
|
|
324 |
[:ex |
|
|
325 |
'oops' printNL.
|
|
326 |
ex proceed
|
|
327 |
]
|
|
328 |
from:o1
|
|
329 |
do:
|
|
330 |
[
|
|
331 |
o1 open.
|
|
332 |
o2 open
|
|
333 |
]
|
|
334 |
"
|
|
335 |
!
|
|
336 |
|
44
|
337 |
catch:aBlock
|
159
|
338 |
"evaluate the argument, aBlock.
|
44
|
339 |
If the receiver-signal is raised during evaluation, abort
|
159
|
340 |
the evaluation and return true; otherwise return false.
|
95
|
341 |
This is the catch & throw mechanism found in other languages,
|
|
342 |
where the returned value indicates if an exception occured."
|
44
|
343 |
|
70
|
344 |
|raiseOccurred|
|
|
345 |
|
|
346 |
raiseOccurred := false.
|
|
347 |
self handle:[:ex | raiseOccurred := true. ex return] do:aBlock.
|
|
348 |
^ raiseOccurred
|
44
|
349 |
|
61
|
350 |
"
|
|
351 |
Object messageNotUnderstoodSignal catch:[
|
159
|
352 |
123 size open
|
|
353 |
]
|
|
354 |
"
|
|
355 |
!
|
|
356 |
|
|
357 |
ignore:aBlock
|
|
358 |
"evaluate the argument, aBlock.
|
|
359 |
Ignore the receiver-signal during evaluation - i.e. simply
|
|
360 |
continue. This makes only sense for some signals, such as UserInterrupt
|
|
361 |
or AbortSignals, because continuing after an exception without any cleanup
|
|
362 |
will often lead to followup-errors."
|
|
363 |
|
|
364 |
^ self handle:[:ex | ex proceed] do:aBlock.
|
|
365 |
|
|
366 |
"
|
|
367 |
Object messageNotUnderstoodSignal ignore:[
|
|
368 |
123 size open
|
61
|
369 |
]
|
|
370 |
"
|
1
|
371 |
! !
|
|
372 |
|
70
|
373 |
!Signal methodsFor:'queries'!
|
|
374 |
|
406
|
375 |
inheritsFrom:anotherSignal
|
|
376 |
"return true, if the receiver is a child of anotherSignal
|
|
377 |
(i.e. if handling anotherSignal also handles the receiver)
|
|
378 |
This is almost the same as accepts, but returns false, if
|
|
379 |
the receiver is identical to anotherSignal."
|
|
380 |
|
|
381 |
self == anotherSignal ifTrue:[^ false].
|
|
382 |
^ anotherSignal accepts:self
|
|
383 |
!
|
|
384 |
|
159
|
385 |
accepts:aSignal
|
|
386 |
"return true, if the receiver accepts the argument, aSignal.
|
214
|
387 |
(i.e. the receiver is aSignal or a parent of it). False otherwise."
|
159
|
388 |
|
|
389 |
|s|
|
|
390 |
|
|
391 |
s := aSignal.
|
|
392 |
[s notNil] whileTrue:[
|
|
393 |
self == s ifTrue:[^ true].
|
|
394 |
s := s parent
|
|
395 |
].
|
|
396 |
^ false
|
|
397 |
!
|
|
398 |
|
259
|
399 |
isSignal
|
|
400 |
"return true, if the receiver is some kind of signal;
|
|
401 |
true returned here - the method is redefined from Object."
|
|
402 |
|
|
403 |
^ true
|
|
404 |
!
|
|
405 |
|
70
|
406 |
isHandled
|
|
407 |
"return true, if there is a handler for the receiver signal.
|
|
408 |
Raising an unhandled signal will usually lead into the debugger,
|
|
409 |
but can be cought globally by setting Exceptions EmergencyHandler."
|
|
410 |
|
171
|
411 |
^ self isHandledIn:(thisContext sender).
|
|
412 |
!
|
|
413 |
|
|
414 |
isHandledIn:aContext
|
|
415 |
"return true, if there is a handler for the receiver signal in the
|
|
416 |
contextChain starting with aContext."
|
|
417 |
|
406
|
418 |
|con sel|
|
70
|
419 |
|
171
|
420 |
con := aContext.
|
70
|
421 |
[con notNil] whileTrue:[
|
406
|
422 |
(((sel := con selector) == #handle:do:)
|
|
423 |
or:[sel == #handle:from:do:]) ifTrue:[
|
159
|
424 |
"
|
|
425 |
is this is the Signal>>handle:do: context
|
|
426 |
or a SignalSet>>handle:do: context with self in it ?
|
|
427 |
"
|
|
428 |
(con receiver accepts:self) ifTrue:[
|
|
429 |
"found a handler context"
|
70
|
430 |
|
159
|
431 |
^ true
|
|
432 |
].
|
|
433 |
].
|
|
434 |
con := con sender
|
70
|
435 |
].
|
|
436 |
^ false
|
|
437 |
! !
|
|
438 |
|
406
|
439 |
!Signal methodsFor:'private'!
|
|
440 |
|
|
441 |
errorStringFor:template
|
|
442 |
"used when raising with a given error string; if the given
|
|
443 |
errorString starts with a space, it is appended to the receivers
|
|
444 |
notifier string; if it ends with a space, it is prepended.
|
|
445 |
Otherwise, the errorString is returned."
|
|
446 |
|
|
447 |
(template startsWith:' ') ifTrue:[
|
|
448 |
^ notifierString , template
|
|
449 |
].
|
|
450 |
(template endsWith:' ') ifTrue:[
|
|
451 |
^ template , notifierString
|
|
452 |
].
|
|
453 |
^ template
|
|
454 |
! !
|
|
455 |
|
1
|
456 |
!Signal methodsFor:'raising'!
|
|
457 |
|
|
458 |
raise
|
|
459 |
"raise a signal - create an Exception object
|
2
|
460 |
and call the handler with this as argument.
|
70
|
461 |
The signals notifierString is used as errorString."
|
1
|
462 |
|
362
|
463 |
^ (Exception
|
159
|
464 |
signal:self
|
|
465 |
parameter:nil
|
|
466 |
errorString:notifierString
|
362
|
467 |
suspendedContext:thisContext sender) raise.
|
|
468 |
!
|
44
|
469 |
|
362
|
470 |
raiseErrorString:aString
|
|
471 |
"raise a signal - create an Exception object
|
|
472 |
and call the handler with this as argument.
|
|
473 |
The argument is used as errorString."
|
|
474 |
|
|
475 |
^ (Exception
|
|
476 |
signal:self
|
|
477 |
parameter:nil
|
406
|
478 |
errorString:(self errorStringFor:aString)
|
362
|
479 |
suspendedContext:thisContext sender) raise.
|
1
|
480 |
!
|
|
481 |
|
329
|
482 |
raiseFrom:something
|
|
483 |
"raise a signal - create an Exception object with aParameter
|
|
484 |
and call the handler with this as argument..
|
362
|
485 |
The argument, something is passed both as parameter and originator.
|
329
|
486 |
XXX: I am not certain, if this is the correct behavior (seen in remoteInvocation-goodie)"
|
|
487 |
|
362
|
488 |
^ (Exception
|
329
|
489 |
signal:self
|
362
|
490 |
parameter:something
|
|
491 |
errorString:notifierString
|
|
492 |
suspendedContext:thisContext sender
|
|
493 |
originator:something) raise.
|
329
|
494 |
!
|
|
495 |
|
255
|
496 |
raiseIn:aContext
|
|
497 |
"raise a signal - create an Exception object
|
|
498 |
and call the handler with this as argument.
|
|
499 |
The signals notifierString is used as errorString.
|
362
|
500 |
The additional context is passed as the context responsible for the raise,
|
|
501 |
allowing a raise to mimicri the exception happened somewhere else."
|
255
|
502 |
|
362
|
503 |
^ (Exception
|
255
|
504 |
signal:self
|
|
505 |
parameter:nil
|
|
506 |
errorString:notifierString
|
362
|
507 |
suspendedContext:aContext) raise.
|
255
|
508 |
!
|
|
509 |
|
329
|
510 |
raiseWith:aParameter
|
|
511 |
"raise a signal - create an Exception object with aParameter
|
|
512 |
and call the handler with this as argument..
|
362
|
513 |
The argument, aParameter is passed as parameter.
|
|
514 |
XXX: I am not certain, if this is the correct behavior (seen in remoteInvocation-goodie)"
|
329
|
515 |
|
362
|
516 |
^ (Exception
|
|
517 |
signal:self
|
|
518 |
parameter:aParameter
|
|
519 |
errorString:notifierString
|
|
520 |
suspendedContext:thisContext sender) raise.
|
329
|
521 |
!
|
|
522 |
|
|
523 |
raiseWith:aParameter errorString:aString
|
|
524 |
"raise a signal - create an Exception object with aParameter
|
|
525 |
and call the handler with this as argument..
|
362
|
526 |
The argument, aString is used as errorString, aParameter is passed
|
|
527 |
as exception parameter."
|
|
528 |
|
|
529 |
^ (Exception
|
|
530 |
signal:self
|
|
531 |
parameter:aParameter
|
406
|
532 |
errorString:(self errorStringFor:aString)
|
362
|
533 |
suspendedContext:thisContext sender) raise.
|
|
534 |
!
|
329
|
535 |
|
362
|
536 |
raiseRequest
|
|
537 |
"raise a signal - create an Exception object
|
|
538 |
and call the handler with this as argument.
|
|
539 |
The signals notifierString is used as errorString."
|
|
540 |
|
|
541 |
^ (Exception
|
|
542 |
signal:self
|
|
543 |
parameter:nil
|
|
544 |
errorString:notifierString
|
|
545 |
suspendedContext:thisContext sender) raiseRequest.
|
329
|
546 |
!
|
|
547 |
|
1
|
548 |
raiseRequestWith:aParameter
|
362
|
549 |
"raise a signal - create a proceedable Exception object with aParameter
|
|
550 |
and look for handlers .
|
70
|
551 |
The signals notifierString is used as errorString."
|
|
552 |
|
362
|
553 |
^ (Exception
|
159
|
554 |
signal:self
|
|
555 |
parameter:aParameter
|
|
556 |
errorString:notifierString
|
362
|
557 |
suspendedContext:thisContext sender) raiseRequest.
|
2
|
558 |
!
|
|
559 |
|
255
|
560 |
raiseRequestWith:aParameter in:aContext
|
|
561 |
"raise a signal - create an Exception object with aParameter
|
|
562 |
and call the handler with this as argument..
|
|
563 |
The signals notifierString is used as errorString.
|
|
564 |
The additional context is passed as the context responsible for the raise."
|
|
565 |
|
362
|
566 |
^ (Exception
|
255
|
567 |
signal:self
|
|
568 |
parameter:aParameter
|
|
569 |
errorString:notifierString
|
362
|
570 |
suspendedContext:aContext) raiseRequest.
|
255
|
571 |
!
|
|
572 |
|
2
|
573 |
raiseRequestWith:aParameter errorString:aString
|
|
574 |
"raise a signal - create an Exception object with aParameter
|
70
|
575 |
and call the handler with this as argument..
|
|
576 |
The argument, aString is used as errorString."
|
1
|
577 |
|
362
|
578 |
^ (Exception
|
159
|
579 |
signal:self
|
|
580 |
parameter:aParameter
|
406
|
581 |
errorString:(self errorStringFor:aString)
|
362
|
582 |
suspendedContext:thisContext sender) raiseRequest
|
255
|
583 |
!
|
|
584 |
|
|
585 |
raiseRequestWith:aParameter errorString:aString in:aContext
|
|
586 |
"raise a signal - create an Exception object with aParameter
|
|
587 |
and call the handler with this as argument..
|
|
588 |
The argument, aString is used as errorString.
|
|
589 |
The additional context is passed as the context responsible for the raise."
|
|
590 |
|
362
|
591 |
^ (Exception
|
255
|
592 |
signal:self
|
|
593 |
parameter:aParameter
|
406
|
594 |
errorString:(self errorStringFor:aString)
|
362
|
595 |
suspendedContext:aContext) raiseRequest
|
1
|
596 |
! !
|