[Zope] uncatchable 'Bad Request' exceptions ?
Florent Guillaume
fg@nuxeo.com
22 Aug 2001 17:00:13 GMT
Zope 2.3.3, python 1.5.2.
>From a python script I can't seem to catch a 'Bad Request' exception.
This doesn't work:
# script1
raise 'Bad Request', 'foo'
# script2
try: context.script1()
except 'Bad Request', x: return x
return 'nothing'
I get a Zope error:
Error Type: Bad Request
Error Value: foo
But the following one works...
# script1
raise 'bar', 'foo'
# script2
try: context.script1()
except 'bar', x: return x
return 'nothing'
And this one too...
# script1
raise 'Bad Request', 'foo'
# script2
try: context.script1()
except: return 'something'
return 'nothing'
Anyone has an idea ? The exception is raised by another product which I
don't want to touch (CMF RegistrationTool), and I think I should be able
to catch them !
Florent Guillaume
Nuxeo