POULibrary.py
changeset 2678 45f1ff6a7f87
parent 2645 d15a997859b1
child 2744 577118ebd179
child 2981 a0932a52e53b
--- a/POULibrary.py	Tue Jun 16 11:12:36 2020 +0200
+++ b/POULibrary.py	Tue Jun 16 15:53:52 2020 +0200
@@ -26,6 +26,10 @@
 from __future__ import absolute_import
 from weakref import ref
 
+# Exception type for problems that user has to take action in order to fix
+class UserAddressedException(Exception):
+    pass
+
 
 class POULibrary(object):
     def __init__(self, CTR, LibName, TypeStack):
@@ -59,6 +63,11 @@
         # Pure python or IEC libs doesn't produce C code
         return ((""), [], False), ""
 
+    def FatalError(self, message):
+        """ Raise an exception that will trigger error message intended to 
+            the user, but without backtrace since it is not a software error """
+
+        raise UserAddressedException(message)
 
 def SimplePOULibraryFactory(path):
     class SimplePOULibrary(POULibrary):