[Seaside] Custom WAErrorHandler

Francois Stephany tulipe.moutarde at gmail.com
Mon Aug 15 14:13:47 UTC 2011


I'm playing with WAErrorHandler lately and wonder how can I generate a 
clean response from it.

For example:

GTRootComponent>>renderContentOn: html
   self renderLoginTabOn: html.
   self renderSocialLinksOn: html.
   self renderMainContentOn: html.
   Dictionary new at: #blop.
   self renderFooterOn: html.

My custom handler looks like this:

handleDefault: anException
   | content answer |
   self sendFailFor: anException.
   anException isResumable
     ifTrue: [ anException resume ].
		
   content := WAHtmlCanvas builder
     fullDocument: true;
     rootBlock: [ :root | root title: 'Unable to proceed' ];
       render: [ :html | html heading level: 1; with: 'Error !' ].
     self requestContext respond: [ :response |
       response
         internalError;
         nextPutAll: content ]

The handler handles the KeyNotFound fine but the response is already 
filled with the rendering of renderLoginTabOn:, renderSocialLinksOn: and 
renderMainContentOn:.

Is there a way to draw on a clean response ? I guess it's pretty 
obvious, I've looked at the requestContext and responseGenerator but 
cannot find  how to do it :/

Cheers,

Francois


More information about the seaside mailing list