[Zope] Resouce not found can't be caught

Dieter Maurer dieter@handshake.de
Fri, 11 Apr 2003 22:16:20 +0200


Thomas Guettler wrote at 2003-4-10 22:00 +0200:
 > The resource not found exception can't be caught. I tried the
 > following:
 > 
 >     def unitTest(self, REQUEST):
 >         "docstring"
 >         try:
 >             self._unitTest(REQUEST)
 >         except:
 >             import traceback
 >             traceback.print_exc()
 > 
 > But I get the meaningless page:
 >  """
 >  Site Error
 >  An error was encountered while publishing this resource.
 >  Resource not found
 >  Sorry, the requested resource does not exist.
 >  Check the URL and try again.
 >  Resource: QWERTZUIOP GET
 >  """
 > 
 > Why is the exception in _unitTest not caught by my exception handler? 
 > I would like to have a stacktrace.

Almost surely, because the exception is caught inside
your "_unitTest" and turned into an error page.


Dieter