26 #ifndef __SMESH_TryCatch_HXX__
27 #define __SMESH_TryCatch_HXX__
33 #include <Utils_SALOME_Exception.hxx>
34 #include <Standard_Failure.hxx>
35 #include <Standard_ErrorHandler.hxx>
36 #include <utilities.h>
40 #ifndef OCC_CATCH_SIGNALS
41 #define OCC_CATCH_SIGNALS
71 #define SMESH_CATCH( onExceptionFun ) \
76 catch (Standard_Failure& ex) \
78 SMESH_Comment text("OCCT Exception: "); \
79 text << ": " << ex.DynamicType()->Name(); \
80 if ( ex.GetMessageString() && strlen( ex.GetMessageString() )) \
81 text << ": " << ex.GetMessageString(); \
82 SMESH_CAUGHT onExceptionFun( text ); \
84 catch ( ::SMESH_ComputeError& ce ) \
86 if ( !ce.myComment.empty() ) \
87 SMESH_CAUGHT onExceptionFun( ce.myComment.c_str() ); \
88 else if ( ce.IsCommon() ) \
89 SMESH_CAUGHT onExceptionFun( ce.CommonName().c_str() ); \
91 SMESH_CAUGHT onExceptionFun \
92 (SMESH_Comment("SMESH_ComputeError: ") << ce.myName ); \
94 catch ( const std::exception& ex) \
96 SMESH_CAUGHT onExceptionFun( ex.what() ); \
100 SMESH_CAUGHT onExceptionFun("Unknown Exception caught"); \
#define SMESHUtils_EXPORT
Definition: SMESH_Utils.hxx:37
Definition: SMESH_ControlsDef.hxx:64
void doNothing(const char *txt)
Definition: SMESH_TryCatch.cxx:31
void throwSalomeEx(const char *txt)
Definition: SMESH_TryCatch.cxx:26
void printErrorInDebugMode(const char *txt)
Definition: SMESH_TryCatch.cxx:42
const char * returnError(const char *txt)
Definition: SMESH_TryCatch.cxx:37