Salome HOME
Added raiseAnException() in the IDL and the engine to test exception mechanism. V7_5_0a1 V7_5_0b1
authorabn <adrien.bruneton@cea.fr>
Mon, 22 Sep 2014 14:36:40 +0000 (16:36 +0200)
committerabn <adrien.bruneton@cea.fr>
Mon, 22 Sep 2014 14:36:40 +0000 (16:36 +0200)
idl/PYHELLO_Gen.idl
src/PYHELLO/PYHELLO.py

index 1824d9cc8706ba354c575de9afd58e931a6fcd10..cfdc2e7c5fd7ef1501fc3f7230d8a751aecaa70b 100644 (file)
@@ -40,7 +40,10 @@ module PYHELLO_ORB
       raises (SALOME::SALOME_Exception);
     
     void createObject(in SALOMEDS::Study theStudy,
-                     in string name)
+                      in string name)
+      raises (SALOME::SALOME_Exception);
+    
+    void raiseAnException()
       raises (SALOME::SALOME_Exception);
   };
 };
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.
     """