[Zope-CMF] how to override raise ???

Dieter Maurer dieter@handshake.de
Sun, 1 Jul 2001 23:20:05 +0200 (CEST)


Robert Rottermann writes:
 > CMF used tons of raise statement to signal conditions to the user.
 > Unfortunately this makes it impossible to translate them to non english
 > without altering the CMF code.
 > 
 > Is there a way to override the behaviour of raise so I get a chance to
 > translate any message it might throw at me?
As far as I know, you can not override "raise".

If the CMF uses class exceptions (rather than string exceptions),
then you can override the exception classes (--> HotFix product).

Otherwise, you may have the chance to catch the exceptions
at a high level (-> ZPublisher.HTTPResponse) and translate
them there. This will not work, if the application catches
exceptions locally and provide its own handling.


Dieter