[wf] use custom exception class 3.5
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 25 Aug 2009 18:26:31 +0200
branch3.5
changeset 2988 89d97d7c0508
parent 2987 5082dec70ed8
child 2989 dfb3506647e4
[wf] use custom exception class
entities/wfobjs.py
--- a/entities/wfobjs.py	Tue Aug 25 18:26:05 2009 +0200
+++ b/entities/wfobjs.py	Tue Aug 25 18:26:31 2009 +0200
@@ -16,6 +16,7 @@
 from cubicweb.interfaces import IWorkflowable
 from cubicweb.common.mixins import MI_REL_TRIGGERS
 
+class WorkflowException(Exception): pass
 
 class Workflow(AnyEntity):
     id = 'Workflow'
@@ -160,7 +161,7 @@
 
     def __init__(self, *args, **kwargs):
         if self.id == 'BaseTransition':
-            raise Exception('should not be instantiated')
+            raise WorkflowException('should not be instantiated')
         super(BaseTransition, self).__init__(*args, **kwargs)
 
     @property