]> SALOME platform Git repositories - samples/pyhello.git/blobdiff - src/PYHELLO/PYHELLO.py
Salome HOME
Added raiseAnException() in the IDL and the engine to test exception mechanism.
[samples/pyhello.git] / src / PYHELLO / PYHELLO.py
index b9592b9f503048fdb43aff48ce29223258a583b9..950463bc287e1f2167687c102b4506f859600d8f 100644 (file)
@@ -67,6 +67,14 @@ class PYHELLO(PYHELLO_ORB__POA.PYHELLO_Gen,
         banner = "Hello %s!" % name
         return banner
 
+    """
+    Intentionnally raises an exception for test purposes.
+    """
+    def raiseAnException( self ):
+        import SALOME
+        exData = SALOME.ExceptionStruct( SALOME.BAD_PARAM, "Test exception in raiseAnException()",'',0)
+        raise SALOME.SALOME_Exception( exData )
+      
     """
     Create object.
     """