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