DCWorkflow raises exception as a str
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zope CMF buildout |
New
|
Undecided
|
Unassigned |
Bug Description
When trying to use DCWorkflow to set a new state variable for a workflow, I get the following traceback:
2012-03-11T11:47:39 ERROR Zope.SiteErrorLog 1331477259.
Traceback (innermost last):
Module ZPublisher.Publish, line 126, in publish
Module ZPublisher.mapply, line 77, in mapply
Module Products.
Module ZPublisher.Publish, line 46, in call_object
Module Products.
Module Products.
Module Products.
TypeError: exceptions must be old-style classes or derived from BaseException, not str
The offending code is found in ContainerTab.py:
(Pdb) l
51 RESPONSE.
52
53 def _checkId(self, id, allow_dup=0):
54 if not allow_dup:
55 if self._mapping.
56 -> raise 'Bad Request', 'The id "%s" is already in use.' %
id
57 return Folder.
58
59 def _getOb(self, name, default=_marker):
60 mapping = self._mapping
61 if mapping.
(Pdb)
Version overview:
Plone 4.2b2 (4203)
CMF 2.2.5
Zope 2.13.12
Python 2.6.6 (r266:84297, Aug 24 2010, 18:13:38) [MSC v.1500 64 bit (AMD64)]
PIL 1.1.7
Just for clarifying: I was trying to set a existing variable as the state variable. Setting a "new" variable (one not from the workflow variables list) works as expected.
The bug reported here is related to the raising of a (apparently) non-valid Exception.