Go to the documentation of this file.
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 <Basics_OCCTVersion.hxx>
37 #include <utilities.h>
41 #ifndef OCC_CATCH_SIGNALS
42 #define OCC_CATCH_SIGNALS
68 #define SMESH_CATCH( onExceptionFun ) \
70 catch (Standard_Failure& ex) \
72 SMESH_Comment text("OCCT Exception: "); \
73 text << ": " << ex.DynamicType()->Name(); \
74 if ( ex.GetMessageString() && strlen( ex.GetMessageString() )) \
75 text << ": " << ex.GetMessageString(); \
76 SMESH_CAUGHT onExceptionFun( text ); \
78 catch ( ::SMESH_ComputeError& ce ) \
80 if ( !ce.myComment.empty() ) \
81 SMESH_CAUGHT onExceptionFun( ce.myComment.c_str() ); \
82 else if ( ce.IsCommon() ) \
83 SMESH_CAUGHT onExceptionFun( ce.CommonName().c_str() ); \
85 SMESH_CAUGHT onExceptionFun \
86 (SMESH_Comment("SMESH_ComputeError: ") << ce.myName ); \
88 catch ( const std::exception& ex) \
90 SMESH_CAUGHT onExceptionFun( ex.what() ); \
97 SMESH_CAUGHT onExceptionFun("Unknown Exception caught"); \