Jean-François Piéronne wrote:
> Very good idea, allowing declaration of a default error page will be
> very useful.
> May be it would be also interesting to allow the declaration of
> HPPTErrorPage for application raised exceptions. For example:
> 
>      HTTPErrorPage = {
>          'NotFound': '/Error404'
>          'SessionExpired': '/Expired',
>          'OneAppException': '/OneAppError',
>          'OnotherAppException': '/AnotherAppError',
>          'default': '/Error'
>      }

Makes sense to me. But in this case, we sould use another notation:

ErrorPage = {
     'HTTPNotFound': '/Error404'
     'HTTPSessionExpired': '/Expired',
     'OneAppException': '/OneAppError',
     'OnotherAppException': '/AnotherAppError',
     'HTTPException': '/HttpError',
     'Exception': '/Error'
}

'HTTPException' would be a catch-all for HTTP errors, 'Exception' for 
all other exceptions. The exception instance is stored in an "_error" 
attribute of the transaction so the servlet can examine it. There is 
already a Boolean attribute "_errorOccurred" which is actually only used 
for the activity log. We could replace that by def errorOccured(self): 
self._error is not None.

One question is whether we want to set errorOccurred also for HTTP 
exceptions. So far it is only set for other exceptions. Should we change 
that? If not, we need to def errorOccured(self): self._error is not None 
and not self._error.isinstance(HTTPException).

-- Chris





-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Webware-devel mailing list
Webware-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/webware-devel

Reply via email to