author | Jan Vrany <jan.vrany@labware.com> |
Tue, 01 Jun 2021 20:19:13 +0100 | |
branch | jv |
changeset 25424 | 51bd8a6b196f |
parent 21292 | 21faad473411 |
permissions | -rw-r--r-- |
4554 | 1 |
" |
2 |
COPYRIGHT (c) 1999 by eXept Software AG |
|
16559 | 3 |
All Rights Reserved |
4554 | 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 |
" |
|
6210
d7039e2ae776
caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents:
5295
diff
changeset
|
12 |
"{ Package: 'stx:libbasic' }" |
d7039e2ae776
caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents:
5295
diff
changeset
|
13 |
|
20146 | 14 |
"{ NameSpace: Smalltalk }" |
15 |
||
8955 | 16 |
GenericException subclass:#NoHandlerError |
4528 | 17 |
instanceVariableNames:'' |
18 |
classVariableNames:'EmergencyHandler' |
|
19 |
poolDictionaries:'' |
|
6210
d7039e2ae776
caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents:
5295
diff
changeset
|
20 |
category:'Kernel-Exceptions-Errors' |
4528 | 21 |
! |
22 |
||
23 |
!NoHandlerError class methodsFor:'documentation'! |
|
24 |
||
4554 | 25 |
copyright |
26 |
" |
|
27 |
COPYRIGHT (c) 1999 by eXept Software AG |
|
16559 | 28 |
All Rights Reserved |
4554 | 29 |
|
30 |
This software is furnished under a license and may be used |
|
31 |
only in accordance with the terms of that license and with the |
|
32 |
inclusion of the above copyright notice. This software may not |
|
33 |
be provided or otherwise made available to, or used by, any |
|
34 |
other person. No title to or ownership of the software is |
|
35 |
hereby transferred. |
|
36 |
" |
|
37 |
||
38 |
||
39 |
! |
|
40 |
||
4528 | 41 |
documentation |
42 |
" |
|
43 |
NoHandlerError is raised, if there is no exception handler |
|
44 |
or default action for an exception. |
|
45 |
||
46 |
The parameter is the unhandled exception. |
|
4554 | 47 |
|
48 |
[Class variables:] |
|
20146 | 49 |
EmergencyHandler <Block> this block is evaluated, if no handler was defined |
50 |
for a signal (i.e. this one is responsible for the |
|
51 |
unhandled exception debugger). |
|
52 |
Having this being a block allows to globally catch |
|
53 |
these errors - even when no enclosing handler-scope |
|
54 |
around the erroneous code exists. |
|
55 |
(as the catch/through does). |
|
4554 | 56 |
|
57 |
||
58 |
[see also:] |
|
20146 | 59 |
GenericException |
60 |
(``Exception handling and signals'': programming/exceptions.html) |
|
4528 | 61 |
" |
4554 | 62 |
! |
63 |
||
64 |
examples |
|
65 |
" |
|
66 |
The emergencyHandler stuff is very useful, to prevent endUser applications |
|
67 |
from entering the debugger. |
|
68 |
||
69 |
Some commonly used (useful) emergency handlers are provided in the |
|
70 |
'useful handlers' section; try them to learn more |
|
71 |
(especially, the mailingHandler is fun). |
|
72 |
||
73 |
Of course, these are only examples - you may define your own handler |
|
74 |
block and pass it to the #emergencyHandler: method. |
|
75 |
||
76 |
BTW: the Launchers 'source & debugger' settings menu allows you |
|
16559 | 77 |
to install either a default or the notifying handler. |
4554 | 78 |
|
79 |
||
80 |
A handler which shows a box, then aborts - (no more debuggers): |
|
16559 | 81 |
[exBegin] |
82 |
NoHandlerError emergencyHandler:(NoHandlerError abortingEmergencyHandler) |
|
83 |
[exEnd] |
|
4554 | 84 |
|
85 |
||
86 |
A handler which aborts - (no box, no debugger): |
|
16559 | 87 |
[exBegin] |
88 |
NoHandlerError emergencyHandler:[:ex | AbortSignal raise] |
|
89 |
[exEnd] |
|
4554 | 90 |
|
91 |
||
92 |
try some exception (for demonstration, in some other process): |
|
16559 | 93 |
[exBegin] |
94 |
[ |
|
95 |
#(1 2 3) at:4 |
|
96 |
] fork. |
|
97 |
[exEnd] |
|
4554 | 98 |
|
99 |
cleanup (switch back to the regular handler, which enters the debugger): |
|
16559 | 100 |
[exBegin] |
101 |
NoHandlerError emergencyHandler:nil |
|
102 |
[exEnd] |
|
4554 | 103 |
|
104 |
||
105 |
A handler which shows a warnBox and asks for debugging: |
|
16559 | 106 |
[exBegin] |
107 |
NoHandlerError emergencyHandler:(NoHandlerError notifyingEmergencyHandler) |
|
108 |
[exEnd] |
|
4554 | 109 |
|
110 |
||
111 |
||
112 |
A handler which dumps information to a file (watch the file 'errorTrace.stx'): |
|
16559 | 113 |
[exBegin] |
114 |
NoHandlerError emergencyHandler:(NoHandlerError dumpingEmergencyHandler) |
|
115 |
[exEnd] |
|
4554 | 116 |
|
117 |
||
118 |
||
119 |
A handler which sends you mail: |
|
16559 | 120 |
[exBegin] |
121 |
NoHandlerError emergencyHandler:(NoHandlerError mailingEmergencyHandler) |
|
122 |
[exEnd] |
|
4554 | 123 |
" |
124 |
||
4528 | 125 |
! ! |
126 |
||
127 |
!NoHandlerError class methodsFor:'initialization'! |
|
128 |
||
129 |
initialize |
|
130 |
||
131 |
NotifierString := 'unhandled exception'. |
|
132 |
||
133 |
" |
|
134 |
self initialize |
|
135 |
" |
|
136 |
||
137 |
||
138 |
! ! |
|
139 |
||
8678 | 140 |
!NoHandlerError class methodsFor:'accessing emergencyHandler'! |
4528 | 141 |
|
142 |
emergencyHandler |
|
143 |
"return the handler used for unhandled exceptions. |
|
144 |
||
16559 | 145 |
If no EmergencyHandler has been set, a handler which enters the |
4528 | 146 |
debugger is returned. |
147 |
The debugger is opened by asking the signal for a debug action, |
|
148 |
this allows to provide other debuggers in specialized (subclass-instances) |
|
149 |
of Signal (if that is ever needed)" |
|
150 |
||
151 |
" |
|
152 |
set it up, when called the first time |
|
153 |
" |
|
154 |
EmergencyHandler isNil ifTrue:[ |
|
16559 | 155 |
EmergencyHandler := |
156 |
[:ex | |
|
157 |
" |
|
158 |
sending it to the signal allows per-signal specific |
|
159 |
debuggers to be implemented in the future |
|
160 |
(for example, segv in primitive code could show things |
|
161 |
on the C-level ..) |
|
162 |
" |
|
163 |
ex creator openDebuggerOnException:ex. |
|
8678 | 164 |
|
16559 | 165 |
"if we arrive here, the debugger did proceed. |
166 |
the value returned by #openDebuggerOnException: is the exceptions value ..." |
|
167 |
] |
|
4528 | 168 |
]. |
169 |
||
170 |
^ EmergencyHandler |
|
12790 | 171 |
|
172 |
" |
|
173 |
NoHandlerError emergencyHandler:[:ex | Transcript showCR:ex description. |
|
16559 | 174 |
ex signal openDebuggerOnException:ex]. |
12790 | 175 |
" |
4528 | 176 |
! |
177 |
||
178 |
emergencyHandler:aOneArgBlock |
|
179 |
"set the handler used for unhandled exceptions. |
|
180 |
The default (a nil-handler) leads to a debugger to be shown." |
|
181 |
||
182 |
EmergencyHandler := aOneArgBlock |
|
183 |
||
184 |
"ST-80 behavior of first showing a notifier: |
|
185 |
(I prefer to get right into the debugger, though) |
|
186 |
||
8678 | 187 |
NoHandlerError |
16559 | 188 |
emergencyHandler: |
189 |
[:ex | self errorNotify:ex description ] |
|
4528 | 190 |
" |
191 |
||
192 |
"ST-X behavior of going right into the debugger: |
|
193 |
||
8678 | 194 |
NoHandlerError |
16559 | 195 |
emergencyHandler:nil |
4528 | 196 |
" |
197 |
||
198 |
"automatically aborting current operation, on error: |
|
16559 | 199 |
(may be useful for end-user apps; make certain, |
4528 | 200 |
you have abortSignal handlers at appropriate places) |
201 |
||
8678 | 202 |
NoHandlerError |
16559 | 203 |
emergencyHandler: |
204 |
[:ex | AbortOperationRequest raise. ex return. ] |
|
4528 | 205 |
" |
206 |
||
207 |
"finally, traditional language system behavior; dump core ;-) |
|
208 |
||
8678 | 209 |
NoHandlerError |
16559 | 210 |
emergencyHandler: |
211 |
[:ex | Smalltalk exitWithCoreDump. ] |
|
4528 | 212 |
" |
213 |
||
214 |
"Modified: 15.1.1997 / 20:49:06 / cg" |
|
8678 | 215 |
! ! |
4528 | 216 |
|
8678 | 217 |
!NoHandlerError class methodsFor:'useful emergency handlers'! |
218 |
||
219 |
abortingEmergencyHandler |
|
220 |
"return a block (usable as an emergency handler), |
|
221 |
which aborts after showing a warnBox. |
|
222 |
This is useful for endUser applications." |
|
223 |
||
224 |
^ [:ex | self warn:'Error: ' , ex description. |
|
16559 | 225 |
AbortOperationRequest raise |
8678 | 226 |
] |
227 |
||
228 |
"test with (try a few halts or CTRL-C's): |
|
229 |
NoHandlerError emergencyHandler:(NoHandlerError abortingEmergencyHandler) |
|
230 |
" |
|
231 |
||
232 |
"back with: |
|
233 |
NoHandlerError emergencyHandler:(NoHandlerError notifyingEmergencyHandler) |
|
234 |
NoHandlerError emergencyHandler:nil |
|
235 |
" |
|
236 |
||
237 |
"Created: 15.1.1997 / 20:13:06 / cg" |
|
238 |
"Modified: 15.1.1997 / 20:15:02 / cg" |
|
239 |
! |
|
240 |
||
241 |
dumpingEmergencyHandler |
|
242 |
"return a block (usable as an emergency handler), |
|
243 |
which dumps the stackBacktrace to a trace file and |
|
244 |
aborts after showing a warnBox. |
|
245 |
This is useful, for endUser application, which are still being |
|
246 |
debugged (i.e. the programmers may have a look at the traceFile |
|
247 |
from time to time). |
|
248 |
||
249 |
Notice: |
|
16559 | 250 |
The code below is just an example; you may want to change the |
251 |
name of the error-file in your application |
|
252 |
(but please: copy the code; do not modify here)" |
|
8678 | 253 |
|
254 |
^ [:ex | |
|
16559 | 255 |
|str printedException| |
8678 | 256 |
|
16559 | 257 |
ex creator == NoHandlerError ifTrue:[ |
258 |
printedException := ex exception. |
|
259 |
] ifFalse:[ |
|
260 |
printedException := ex |
|
261 |
]. |
|
8678 | 262 |
|
16559 | 263 |
"/ user interruption is handled specially: |
264 |
"/ allow user to choose between proceeding or aborting |
|
265 |
"/ but never dump that information to the file. |
|
8678 | 266 |
|
16559 | 267 |
printedException creator == Object userInterruptSignal ifTrue:[ |
268 |
(self confirm:'abort current action ?') ifTrue:[ |
|
269 |
AbortOperationRequest raise |
|
270 |
]. |
|
271 |
ex proceedWith:nil |
|
272 |
]. |
|
8678 | 273 |
|
16559 | 274 |
"/ |
275 |
"/ dump it to 'errorTrace.stx' |
|
276 |
"/ |
|
277 |
str := 'errorTrace.stx' asFilename appendingWriteStream. |
|
8678 | 278 |
|
16559 | 279 |
str nextPutLine:('******************************* ' |
280 |
, Timestamp now printString |
|
281 |
, ' *******************************'). |
|
282 |
str cr. |
|
8678 | 283 |
|
16559 | 284 |
str nextPutLine:('** Error: ' , printedException description). |
285 |
str nextPutLine:('** Signal: ' , printedException creator printString). |
|
286 |
str nextPutLine:('** Parameter: ' , printedException parameter printString). |
|
287 |
str nextPutLine:('** Process: ' , Processor activeProcess printString). |
|
288 |
str nextPutLine:('** Backtrace:'). |
|
289 |
str cr. |
|
8678 | 290 |
|
16559 | 291 |
printedException suspendedContext fullPrintAllOn:str. |
292 |
str cr. |
|
293 |
str cr. |
|
294 |
str close. |
|
8678 | 295 |
|
16559 | 296 |
"/ send a line to stdErr |
8678 | 297 |
|
16559 | 298 |
('[warning]: ignored error: ' , printedException description) errorPrintCR. |
299 |
('[warning]: error information appended to ''errorTrace.stx''') errorPrintCR. |
|
8678 | 300 |
|
16559 | 301 |
AbortOperationRequest raise |
8678 | 302 |
] |
303 |
||
304 |
"test with (try a few halts or CTRL-C's): |
|
305 |
NoHandlerError emergencyHandler:(NoHandlerError dumpingEmergencyHandler) |
|
306 |
" |
|
307 |
||
308 |
"back with: |
|
309 |
NoHandlerError emergencyHandler:(NoHandlerError notifyingEmergencyHandler) |
|
310 |
NoHandlerError emergencyHandler:nil |
|
311 |
" |
|
312 |
||
313 |
"Created: / 15.1.1997 / 20:14:52 / cg" |
|
314 |
"Modified: / 24.1.1997 / 20:36:21 / cg" |
|
315 |
"Modified: / 4.8.1999 / 08:11:20 / stefan" |
|
316 |
! |
|
317 |
||
318 |
mailingEmergencyHandler |
|
319 |
"return a block (usable as an emergency handler), |
|
320 |
which shows a warnBox and optionally mails a stackBacktrace to a maintainer. |
|
321 |
This is useful, for endUser application, which are still being |
|
322 |
debugged (i.e. the programmers may have a look at the errors). |
|
323 |
||
324 |
Notice: the stuff here is a demonstration only; it should be modified |
|
16559 | 325 |
for your particular environment ... |
326 |
... but please: copy the code and modify there; |
|
327 |
leave the stuff below as it is." |
|
8678 | 328 |
|
329 |
^ [:ex | |
|
16559 | 330 |
|str printedException doMail emergencyMailReceiver pipe| |
8678 | 331 |
|
16559 | 332 |
ex creator == NoHandlerError ifTrue:[ |
333 |
printedException := ex exception. |
|
334 |
] ifFalse:[ |
|
335 |
printedException := ex |
|
336 |
]. |
|
8678 | 337 |
|
16559 | 338 |
"/ user interruption is handled specially: |
339 |
"/ allow user to choose between proceeding or aborting |
|
340 |
"/ but never dump that information to the file. |
|
8678 | 341 |
|
16559 | 342 |
printedException creator == UserInterrupt ifTrue:[ |
343 |
(self confirm:'abort current action ?') ifTrue:[ |
|
344 |
AbortOperationRequest raise |
|
345 |
]. |
|
346 |
ex proceedWith:nil |
|
347 |
]. |
|
8678 | 348 |
|
16559 | 349 |
"/ somehow get the name of the guy to receive the mail |
350 |
"/ you have to implement that yourself. |
|
8678 | 351 |
|
16559 | 352 |
"/ emergencyMailReceiver := OneOfYourClass getEmergencyMailReceiver. |
353 |
emergencyMailReceiver := OperatingSystem getLoginName. |
|
8678 | 354 |
|
16559 | 355 |
emergencyMailReceiver isNil ifTrue:[ |
356 |
self warn:(printedException description |
|
357 |
, '\\No mailing to service people possible.') withCRs. |
|
358 |
doMail := false. |
|
359 |
] ifFalse:[ |
|
360 |
doMail := self confirm:(printedException description |
|
361 |
, '\\Mail error information to the service people (' |
|
362 |
, emergencyMailReceiver , ') ?') withCRs |
|
363 |
]. |
|
364 |
doMail ifTrue:[ |
|
365 |
str := '' writeStream. |
|
8678 | 366 |
|
16559 | 367 |
str nextPutLine:('Error notification from ' |
368 |
, OperatingSystem getLoginName |
|
369 |
, '@' |
|
370 |
, OperatingSystem getHostName). |
|
371 |
str cr. |
|
8678 | 372 |
|
16559 | 373 |
str nextPutLine:('Time: ' , Timestamp now printString). |
374 |
str nextPutLine:('Error: ', printedException description). |
|
375 |
str nextPutLine:('Signal: ', printedException creator printString). |
|
376 |
str nextPutLine:('Parameter: ', printedException parameter printString). |
|
377 |
str nextPutLine:('Process: ', Processor activeProcess printString). |
|
378 |
str nextPutLine:'Backtrace:'. |
|
379 |
str cr. |
|
8678 | 380 |
|
16559 | 381 |
printedException suspendedContext fullPrintAllOn:str. |
382 |
str cr;cr. |
|
8678 | 383 |
|
16559 | 384 |
str close. |
8678 | 385 |
|
16559 | 386 |
pipe := PipeStream |
387 |
writingTo:'mail ', emergencyMailReceiver. |
|
388 |
pipe notNil ifTrue:[ |
|
389 |
pipe nextPutLine:'Subject: automatic error report'. |
|
390 |
pipe nextPutAll:str contents. |
|
391 |
pipe cr. |
|
392 |
pipe close. |
|
393 |
] |
|
394 |
]. |
|
8678 | 395 |
|
16559 | 396 |
AbortOperationRequest raise. |
397 |
"not reached" |
|
8678 | 398 |
] |
399 |
||
400 |
"test with (try a few halts or CTRL-C's): |
|
401 |
NoHandlerError emergencyHandler:(NoHandlerError mailingEmergencyHandler) |
|
402 |
" |
|
403 |
||
404 |
"back with: |
|
405 |
NoHandlerError emergencyHandler:(NoHandlerError notifyingEmergencyHandler) |
|
406 |
NoHandlerError emergencyHandler:nil |
|
407 |
" |
|
408 |
||
409 |
"Created: / 15.1.1997 / 20:14:52 / cg" |
|
410 |
"Modified: / 15.1.1997 / 21:10:28 / cg" |
|
411 |
"Modified: / 4.8.1999 / 08:11:26 / stefan" |
|
412 |
! |
|
413 |
||
414 |
notifyingEmergencyHandler |
|
415 |
"return a block (usable as an emergency handler for exceptions), |
|
416 |
which does errorNotification before going into the debugger. |
|
417 |
Halts and breakpoints go directly into the debugger (without asking)" |
|
418 |
||
419 |
^ [:ex | |
|
16559 | 420 |
|message| |
11233
4c35e5414ddf
got rid of the \"unhandled...(\" prefix in the debugger;
Claus Gittinger <cg@exept.de>
parents:
10731
diff
changeset
|
421 |
|
16559 | 422 |
message := ex descriptionForDebugger. |
11233
4c35e5414ddf
got rid of the \"unhandled...(\" prefix in the debugger;
Claus Gittinger <cg@exept.de>
parents:
10731
diff
changeset
|
423 |
|
16559 | 424 |
(ex creator == NoHandlerError |
425 |
and:[(ControlInterrupt handles:ex exception) |
|
426 |
and:[(ControlInterrupt ~~ ex exception creator) ]]) ifTrue:[ |
|
427 |
"/ go directly into the debugger ... |
|
428 |
^ Debugger |
|
429 |
enter:ex returnableSuspendedContext |
|
430 |
withMessage:message |
|
431 |
mayProceed:ex mayProceed. |
|
432 |
]. |
|
433 |
"/ ask, and maybe go into the debugger ... |
|
434 |
^ nil |
|
435 |
errorNotify:message |
|
436 |
from:ex returnableSuspendedContext |
|
437 |
allowDebug:true |
|
438 |
mayProceed:ex mayProceed. |
|
8678 | 439 |
] |
440 |
||
441 |
"test with (NOTE: halt, breakpoints or CTRL-C's still go straight into the debugger): |
|
442 |
NoHandlerError emergencyHandler:(NoHandlerError notifyingEmergencyHandler). |
|
443 |
Object bla. |
|
444 |
" |
|
445 |
||
446 |
"back with: |
|
447 |
NoHandlerError emergencyHandler:nil |
|
448 |
" |
|
449 |
||
450 |
"Modified: / 16.11.2001 / 16:07:05 / cg" |
|
451 |
! |
|
452 |
||
453 |
notifyingEmergencyHandlerForUserProcesses |
|
454 |
"return a block (usable as an emergency handler for exceptions), |
|
455 |
which does errorNotification before going into the debugger, |
|
456 |
but only for exceptions occurring in user processes; |
|
457 |
systemProcesses are not debugged. |
|
458 |
Halts and breakpoints go directly into the debugger (without asking)" |
|
459 |
||
460 |
^ [:ex | |
|
461 |
||
16559 | 462 |
|theException message| |
8678 | 463 |
|
16559 | 464 |
Processor activeProcessIsSystemProcess ifTrue:[ |
465 |
'EmergencyHandler [info]: exception caught: ' errorPrint. |
|
466 |
ex creator == NoHandlerError ifTrue:[ |
|
467 |
theException := ex exception. |
|
468 |
] ifFalse:[ |
|
469 |
theException := ex |
|
470 |
]. |
|
471 |
theException description errorPrintCR. |
|
472 |
AbortOperationRequest raise. |
|
473 |
] ifFalse:[ |
|
474 |
message := ex descriptionForDebugger. |
|
11233
4c35e5414ddf
got rid of the \"unhandled...(\" prefix in the debugger;
Claus Gittinger <cg@exept.de>
parents:
10731
diff
changeset
|
475 |
|
16559 | 476 |
(ex creator == NoHandlerError |
477 |
and:[ (ControlInterrupt handles:ex exception) |
|
478 |
and:[ (ControlInterrupt ~~ ex exception creator) ]]) ifTrue:[ |
|
479 |
"/ go directly into the debugger ... |
|
480 |
^ Debugger |
|
481 |
enter:ex returnableSuspendedContext |
|
482 |
withMessage:message |
|
483 |
mayProceed:ex mayProceed. |
|
484 |
]. |
|
485 |
"/ ask, and maybe go into the debugger ... |
|
486 |
^ nil |
|
487 |
errorNotify:message |
|
488 |
from:ex returnableSuspendedContext |
|
489 |
allowDebug:true |
|
490 |
mayProceed:ex mayProceed. |
|
491 |
] |
|
8678 | 492 |
] |
493 |
||
494 |
"test with: |
|
495 |
NoHandlerError emergencyHandler:(NoHandlerError notifyingEmergencyHandlerForUserProcesses) |
|
496 |
Object bla. |
|
497 |
" |
|
498 |
||
499 |
"back with: |
|
500 |
NoHandlerError emergencyHandler:nil |
|
501 |
" |
|
502 |
||
503 |
"Modified: / 16.11.2001 / 16:06:54 / cg" |
|
504 |
! ! |
|
505 |
||
506 |
!NoHandlerError methodsFor:'accessing'! |
|
507 |
||
15110 | 508 |
exception |
509 |
"the original exception, which was responsible for this. |
|
510 |
ANSI compatibility" |
|
511 |
||
512 |
^ parameter |
|
513 |
! |
|
514 |
||
14963 | 515 |
originalSignal |
516 |
"return the signal/exception which was originally raised. |
|
15110 | 517 |
For noHandler, that is my unhandled signal; for others, that's the exception itself." |
14963 | 518 |
|
519 |
^ parameter originalSignal. |
|
520 |
! |
|
521 |
||
8678 | 522 |
unhandledException |
21281 | 523 |
<resource: #obsolete> |
15110 | 524 |
"the original exception, which was responsible for this. |
525 |
Obsolete: use #exception for ANSI comatibility." |
|
526 |
||
8678 | 527 |
^ parameter |
4528 | 528 |
! ! |
529 |
||
530 |
!NoHandlerError methodsFor:'default actions'! |
|
531 |
||
532 |
defaultAction |
|
533 |
"This action is performed, if nobody handles the NoHandlerError. |
|
16559 | 534 |
Look for either a per-process emergencyHandlerBlock |
10731 | 535 |
or the global emergencyHandler ..." |
4528 | 536 |
|
537 |
|block| |
|
538 |
||
16559 | 539 |
Processor notNil ifTrue:[ |
540 |
"care for signal during startup (Processor not yet created)" |
|
541 |
block := Processor activeProcess emergencySignalHandler. |
|
4528 | 542 |
]. |
543 |
block isNil ifTrue:[ |
|
16559 | 544 |
block := self class emergencyHandler. |
545 |
block isNil ifTrue:[ |
|
546 |
"care for error during startup (Exception not yet initialized)" |
|
547 |
^ MiniDebugger |
|
548 |
enterWithMessage:self description |
|
549 |
mayProceed:self mayProceed |
|
550 |
]. |
|
4528 | 551 |
]. |
552 |
||
4586
22c84f7f9b85
return nil from raise if proceeded in the debugger
Claus Gittinger <cg@exept.de>
parents:
4561
diff
changeset
|
553 |
^ block value:self |
4561 | 554 |
! |
555 |
||
556 |
noHandler |
|
557 |
"redefined to avoid recursive invocations" |
|
558 |
||
559 |
^ self |
|
4528 | 560 |
! ! |
561 |
||
11233
4c35e5414ddf
got rid of the \"unhandled...(\" prefix in the debugger;
Claus Gittinger <cg@exept.de>
parents:
10731
diff
changeset
|
562 |
!NoHandlerError methodsFor:'printing & storing'! |
4c35e5414ddf
got rid of the \"unhandled...(\" prefix in the debugger;
Claus Gittinger <cg@exept.de>
parents:
10731
diff
changeset
|
563 |
|
4c35e5414ddf
got rid of the \"unhandled...(\" prefix in the debugger;
Claus Gittinger <cg@exept.de>
parents:
10731
diff
changeset
|
564 |
descriptionForDebugger |
16559 | 565 |
"return the description string of the signal which is used in the |
11233
4c35e5414ddf
got rid of the \"unhandled...(\" prefix in the debugger;
Claus Gittinger <cg@exept.de>
parents:
10731
diff
changeset
|
566 |
debugger title area" |
4c35e5414ddf
got rid of the \"unhandled...(\" prefix in the debugger;
Claus Gittinger <cg@exept.de>
parents:
10731
diff
changeset
|
567 |
|
4c35e5414ddf
got rid of the \"unhandled...(\" prefix in the debugger;
Claus Gittinger <cg@exept.de>
parents:
10731
diff
changeset
|
568 |
^ parameter description. |
4c35e5414ddf
got rid of the \"unhandled...(\" prefix in the debugger;
Claus Gittinger <cg@exept.de>
parents:
10731
diff
changeset
|
569 |
! ! |
4c35e5414ddf
got rid of the \"unhandled...(\" prefix in the debugger;
Claus Gittinger <cg@exept.de>
parents:
10731
diff
changeset
|
570 |
|
4539
7064506e8285
debugger entry protocol changed;
Claus Gittinger <cg@exept.de>
parents:
4528
diff
changeset
|
571 |
!NoHandlerError methodsFor:'queries'! |
7064506e8285
debugger entry protocol changed;
Claus Gittinger <cg@exept.de>
parents:
4528
diff
changeset
|
572 |
|
7064506e8285
debugger entry protocol changed;
Claus Gittinger <cg@exept.de>
parents:
4528
diff
changeset
|
573 |
mayProceed |
7064506e8285
debugger entry protocol changed;
Claus Gittinger <cg@exept.de>
parents:
4528
diff
changeset
|
574 |
"return true, if the exception handler is allowed to proceed |
20249 | 575 |
the execution where the exception occurred." |
4539
7064506e8285
debugger entry protocol changed;
Claus Gittinger <cg@exept.de>
parents:
4528
diff
changeset
|
576 |
|
10731 | 577 |
^ parameter isNil or:[parameter mayProceed]. |
4539
7064506e8285
debugger entry protocol changed;
Claus Gittinger <cg@exept.de>
parents:
4528
diff
changeset
|
578 |
! ! |
7064506e8285
debugger entry protocol changed;
Claus Gittinger <cg@exept.de>
parents:
4528
diff
changeset
|
579 |
|
4528 | 580 |
!NoHandlerError class methodsFor:'documentation'! |
581 |
||
582 |
version |
|
20146 | 583 |
^ '$Header$' |
12790 | 584 |
! |
585 |
||
586 |
version_CVS |
|
20146 | 587 |
^ '$Header$' |
4528 | 588 |
! ! |
7586 | 589 |
|
14963 | 590 |
|
4528 | 591 |
NoHandlerError initialize! |