PLCGenerator.py
changeset 171 e3d47b4bbd5d
parent 168 fb500cc79164
child 189 43cd3ef83a1f
--- a/PLCGenerator.py	Tue Feb 26 15:15:27 2008 +0100
+++ b/PLCGenerator.py	Tue Feb 26 15:16:30 2008 +0100
@@ -37,6 +37,9 @@
 datatypeComputed = {}
 pouComputed = {}
 
+class PLCGenException(Exception):
+    pass
+
 def ReIndentText(text, nb_spaces):
     compute = ""
     lines = text.splitlines()
@@ -114,7 +117,7 @@
         if pou_type in pouTypeNames:
             pou_program = PouProgram(pou.getname(), pouTypeNames[pou_type])
         else:
-            raise ValueError, "Undefined pou type"
+            raise PLCGenException, "Undefined pou type"
         pou_program.GenerateInterface(pou.getinterface())
         pou_program.GenerateConnectionTypes(pou)
         pou_program.GenerateProgram(pou)
@@ -538,7 +541,7 @@
                             expression = self.ComputeFBDExpression(body, connections[0], order)
                             self.ComputedConnectors[name] = expression
                             return expression
-            raise ValueError, "No connector found"
+            raise PLCGenException, "No connector found"
 
     def GenerateLDPaths(self, connections, body):
         paths = []