# HG changeset patch # User Claus Gittinger # Date 854134654 -3600 # Node ID 1d9e88f6550eeae8d95178acd23f26bbb613d62c # Parent ffd565c6e0845aaff684144b91e21610271c5ec6 checkin from browser diff -r ffd565c6e084 -r 1d9e88f6550e Exception.st --- a/Exception.st Fri Jan 24 19:16:48 1997 +0100 +++ b/Exception.st Fri Jan 24 20:37:34 1997 +0100 @@ -327,54 +327,58 @@ from time to time). Notice: - The code below is just an example; you may want to change the - name of the error-file in your application - (but please: copy the code; do not modify here)" + The code below is just an example; you may want to change the + name of the error-file in your application + (but please: copy the code; do not modify here)" ^ [:ex | - |str printedException| + |str printedException| - ex signal == Signal noHandlerSignal ifTrue:[ - printedException := ex parameter. - ] ifFalse:[ - printedException := ex - ]. + ex signal == Signal noHandlerSignal ifTrue:[ + printedException := ex parameter. + ] ifFalse:[ + printedException := ex + ]. + + "/ user interruption is handled specially: + "/ allow user to choose between proceeding or aborting + "/ but never dump that information to the file. - "/ user interruption is handled specially: - "/ allow user to choose between proceeding or aborting - "/ but never dump that information to the file. + printedException signal == Object userInterruptSignal ifTrue:[ + (self confirm:'abort current action ?') ifTrue:[ + AbortSignal raise + ]. + ex proceed + ]. - printedException signal == Object userInterruptSignal ifTrue:[ - (self confirm:'abort current action ?') ifTrue:[ - AbortSignal raise - ]. - ex proceed - ]. + "/ + "/ dump it to 'errorTrace.stx' + "/ + str := 'errorTrace.stx' asFilename appendingWriteStream. - "/ - "/ dump it to 'errorTrace.stx' - "/ - str := 'errorTrace.stx' asFilename appendingWriteStream. - - str nextPutLine:('******************************* ' - , AbsoluteTime now printString - , ' *******************************'). - str cr. + str nextPutLine:('******************************* ' + , AbsoluteTime now printString + , ' *******************************'). + str cr. - str nextPutLine:('** Error: ' , printedException errorString). - str nextPutLine:('** Signal: ' , printedException signal printString). - str nextPutLine:('** Parameter: ' , printedException parameter printString). - str nextPutLine:('** Process: ' , Processor activeProcess printString). - str nextPutLine:('** Backtrace:'). - str cr. + str nextPutLine:('** Error: ' , printedException errorString). + str nextPutLine:('** Signal: ' , printedException signal printString). + str nextPutLine:('** Parameter: ' , printedException parameter printString). + str nextPutLine:('** Process: ' , Processor activeProcess printString). + str nextPutLine:('** Backtrace:'). + str cr. - printedException suspendedContext fullPrintAllOn:str. - str cr. - str cr. - str close. + printedException suspendedContext fullPrintAllOn:str. + str cr. + str cr. + str close. - self warn:printedException errorString. - AbortSignal raise + "/ send a line to stdErr + + ('[warning]: ignored error: ' , printedException errorString) errorPrintCR. + ('[warning]: error information appended to ''errorTrace.stx''') errorPrintCR. + + AbortSignal raise ] "test with (try a few halts or CTRL-C's): @@ -387,7 +391,7 @@ " "Created: 15.1.1997 / 20:14:52 / cg" - "Modified: 15.1.1997 / 21:07:14 / cg" + "Modified: 24.1.1997 / 20:36:21 / cg" ! mailingEmergencyHandler @@ -873,6 +877,6 @@ !Exception class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libbasic/Exception.st,v 1.47 1997-01-21 23:49:21 cg Exp $' + ^ '$Header: /cvs/stx/stx/libbasic/Exception.st,v 1.48 1997-01-24 19:37:34 cg Exp $' ! ! Exception initialize!