#include <qstring.h>
+#include <CASCatch_CatchSignals.hxx>
+#include <CASCatch_ErrorHandler.hxx>
+#include <CASCatch_Failure.hxx>
+
+
/*!Constructor. Initialize by \a floatSignal.*/
SalomeApp_ExceptionHandler::SalomeApp_ExceptionHandler( const bool floatSignal )
: SUIT_ExceptionHandler()
/*!Try to call SUIT_ExceptionHandler::internalHandle(o, e), catch if failure.*/
bool SalomeApp_ExceptionHandler::handleSignals( QObject* o, QEvent* e )
{
- try {
+
+ CASCatch_CatchSignals aCatchSignals;
+ aCatchSignals.Activate();
+
+
+ CASCatch_TRY {
SUIT_ExceptionHandler::internalHandle( o, e );
}
- catch( Standard_Failure )
- {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- throw std::runtime_error( aFail->GetMessageString() );
+ CASCatch_CATCH(CASCatch_Failure) {
+ aCatchSignals.Deactivate();
+ Handle(CASCatch_Failure) aFail = CASCatch_Failure::Caught();
+ throw std::runtime_error( aFail->GetError() );
}
+
+ aCatchSignals.Deactivate();
return true;
}
#include <stdexcept>
#include <qapplication.h>
-#include "CASCatch_SignalsHandler.h" // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
-
+#include <CASCatch_CatchSignals.hxx>
+#include <CASCatch_ErrorHandler.hxx>
+#include <CASCatch_Failure.hxx>
extern "C" int HandleSignals(QApplication *theQApplication)
{
- CASCatch_SignalsHandler aSignalsHandler;
- int aRet = -1;
- try {
+ int aRet = -1;
+ CASCatch_CatchSignals aCatchSignals;
+ aCatchSignals.Activate();
+
+ CASCatch_TRY {
aRet = theQApplication->exec();
- }catch(Standard_Failure){
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- throw std::runtime_error(aFail->GetMessageString());
}
+ CASCatch_CATCH(CASCatch_Failure) {
+ aCatchSignals.Deactivate();
+ Handle(CASCatch_Failure) aFail = CASCatch_Failure::Caught();
+ throw std::runtime_error( aFail->GetError() );
+ }
+
+ aCatchSignals.Deactivate();
return aRet;
}