[Seaside] Error handlers and critical sections

C. David Shaffer cdshaffer at acm.org
Thu Sep 13 20:42:31 UTC 2007


In continuing the process of answering myself...

I tried:


[   [1/0] ensure: [Transcript show: 'got it.'; cr].
    Transcript show: 'should not get here.'; cr ]
        on: Error
        do: [:ex | |signalContext handlerContext|
            signalContext := ex instVarNamed: #signalContext.
            handlerContext := ex instVarNamed: #handlerContext.
            signalContext unwindTo: handlerContext.
            self halt]


Seems to work as expected ('got it' shows up in transcript before one 
quits the debugger).  So, I'm trying:

ProductionErrorHandler>>handleError: ex
    |signalContext handlerContext|
    signalContext := ex instVarNamed: #signalContext.
    handlerContext := ex instVarNamed: #handlerContext.
    signalContext unwindTo: handlerContext.
     WACurrentSession value returnResponse: (WAResponse document: self 
document mimeType: 'text/html')


for a bit to see how it goes.   If it seems right I'll embed it in 
exception and avoid all the instVarNamed: stuff.  This makes ensure: and 
critical: release their resources since there is no hope of re-entering 
their contexts.

David



More information about the seaside mailing list