Salome HOME
Updated environment and import/export directives
[modules/kernel.git] / src / Utils / Utils_CorbaException.hxx
index 8bffa2d18f4fdbbf3914c68530d8b68757d53476..a559579f14cb8f86f7d234d96ed7edbda9627ed2 100644 (file)
@@ -29,6 +29,8 @@
 #ifndef _UTILS_CORBAEXCEPTION_HXX_
 #define _UTILS_CORBAEXCEPTION_HXX_
 
+#include <SALOME_Utils.hxx>
+
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(SALOME_Exception)
 
                 throw SALOME::SALOME_Exception(ExDescription); \
               }
 
+#include <ostream>
+
+//Dump the CORBA exception type.
+inline std::ostream& operator<<(std::ostream& os, const CORBA::Exception& e)
+{
+  CORBA::Any tmp;
+  tmp<<= e;
+  CORBA::TypeCode_var tc = tmp.type();
+  const char *p = tc->name();
+  os<<"CORBA Exception was catch of the kind : ";
+  if ( *p != '\0' ) {
+    os<<p;
+  } 
+  else  { 
+    os << tc->id();
+  }
+  
+  return os;
+}
+
 #endif