1 #include "SalomeApp_ExceptionHandler.h"
5 #include <Standard_Failure.hxx>
6 #include <Standard_ErrorHandler.hxx>
13 SalomeApp_ExceptionHandler::SalomeApp_ExceptionHandler( const bool floatSignal )
14 : SUIT_ExceptionHandler()
16 OSD::SetSignal( floatSignal );
19 bool SalomeApp_ExceptionHandler::handleSignals( QObject* o, QEvent* e )
22 SUIT_ExceptionHandler::internalHandle( o, e );
24 catch( Standard_Failure )
26 Handle(Standard_Failure) aFail = Standard_Failure::Caught();
27 throw std::runtime_error( aFail->GetMessageString() );
40 bool SalomeApp_ExceptionHandler::handle( QObject* o, QEvent* e )
43 QString title( "Fatal error" );
46 res = handleSignals( o, e );
48 catch( std::exception& ex )
50 showMessage( title, QString( ex.what() ) );
52 catch( Standard_Failure& e )
54 showMessage( title, QString( e.GetMessageString() ) );
59 showMessage( title, "Unknown Exception" );
66 extern "C" SALOMEAPP_EXPORT SUIT_ExceptionHandler* getExceptionHandler()
68 return new SalomeApp_ExceptionHandler( true );