From: srn Date: Tue, 30 Aug 2005 05:20:29 +0000 (+0000) Subject: Replaced the old execption handler by the new one. X-Git-Tag: V_3_0_2~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c0388d8f5bc9dc9cb1a6bd5e9feefa1483322cf2;p=modules%2Fgui.git Replaced the old execption handler by the new one. --- diff --git a/src/SalomeApp/SalomeApp_ExceptionHandler.cxx b/src/SalomeApp/SalomeApp_ExceptionHandler.cxx index eff88e81e..68abb4c46 100644 --- a/src/SalomeApp/SalomeApp_ExceptionHandler.cxx +++ b/src/SalomeApp/SalomeApp_ExceptionHandler.cxx @@ -10,6 +10,11 @@ #include +#include +#include +#include + + /*!Constructor. Initialize by \a floatSignal.*/ SalomeApp_ExceptionHandler::SalomeApp_ExceptionHandler( const bool floatSignal ) : SUIT_ExceptionHandler() @@ -20,14 +25,21 @@ SalomeApp_ExceptionHandler::SalomeApp_ExceptionHandler( const bool floatSignal ) /*!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; } diff --git a/src/Session/Session_SignalsHandler.cxx b/src/Session/Session_SignalsHandler.cxx index c02f6132a..4eeface46 100755 --- a/src/Session/Session_SignalsHandler.cxx +++ b/src/Session/Session_SignalsHandler.cxx @@ -21,18 +21,25 @@ #include #include -#include "CASCatch_SignalsHandler.h" // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC - +#include +#include +#include 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; }