Salome HOME
MPV:
[modules/yacs.git] / src / SALOMEDS / SALOMEDS_BasicAttributeFactory.cxx
index bd83af147d6b99f0b659e487c85428da0e4d2e0b..6669582475aa0e4daf134d6d7b47a99be56fd755 100644 (file)
@@ -26,9 +26,9 @@
 //  Module : SALOME
 //  $Header$
 
-using namespace std;
 #include "SALOMEDS_BasicAttributeFactory.hxx"
 #include "utilities.h"
+using namespace std;
 
 //============================================================================
 /*! Function : Create
@@ -38,16 +38,17 @@ using namespace std;
 SALOMEDS_BasicAttribute_i* BasicAttributeFactory::Create(const char* type)
     throw (SALOME_Exception)
 {
-  if (!strcmp(type,"AttReal"))
-    {  
-      SALOMEDS_AttReal_i *A = new SALOMEDS_AttReal_i();
-      return A;
-    }
-  else if(!strcmp(type,"AttLong"))
-    {
-      SALOMEDS_AttLong_i *A = new SALOMEDS_AttLong_i();
-      return A;
-    }
-  else throw(SALOME_Exception(LOCALIZED("bad attribute type name")));
-
+  try {
+    if (!strcmp(type,"AttReal"))
+      {  
+       SALOMEDS_AttReal_i *A = new SALOMEDS_AttReal_i();
+       return A;
+      }
+    else if(!strcmp(type,"AttLong"))
+      {
+       SALOMEDS_AttLong_i *A = new SALOMEDS_AttLong_i();
+       return A;
+      }
+    else throw(SALOME_Exception(LOCALIZED("bad attribute type name")));
+  } catch (...) {throw(SALOME_Exception(LOCALIZED("Unexpected exception was caught")));}
 }