14 Dec
2005
14 Dec
'05
7:54 p.m.
Jonathan wrote:
I am trying to catch a 'BadRequest' exception in the following python script excerpt:
for item in itemList: try: context.afolder.manage_delObjects([item]) except BadRequest: continue
NameError: global name 'BadRequest' is not defined
The following would normally be required, but it fails with an ImportError: from zExceptions import BadRequest So you could try this instead: for item in itemList: try: context.afolder.manage_delObjects([item]) except: continue In general, TTW coding is very limited; you can use External Methods (a.k.a. Extensions) or Products to avoid this.