[Zope] catching BadRequest exceptions
Dieter Maurer
dieter at handshake.de
Sat Mar 4 14:28:51 EST 2006
Palermo, Tom wrote at 2006-3-3 13:56 -0500:
> ...
>It seems that BadRequest exceptions, like the ones thrown by checkValidId()
>in OFS.ObjectManager (lib/python/OFS/ObjectManager.py), are not handled by a
>standard_error_message.
Some "BadRequest" exceptions are not handled by "standard_error_message"
(a bug, please file a bug report). But, this is not
the case for the one from "checkValidId".
Affected are errors detected in "REQUEST.processInputs()".
They are not handled by "standard_error_message" because
they are detected too early -- before traversal has even begun.
As a result, there is not yet any "standard_error_message" in
the request context.
These errors are usually type errors during conversion
of request parameters called for by ":<type>" suffixes, e.g.
"start:int=a" would cause such an error.
The easy workaround is not to use such ZPublisher type conversions
but perform the conversions yourself in your application code.
--
Dieter
More information about the Zope
mailing list