X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSalomeApp%2FSalomeApp_Study.cxx;h=70bd944cbdf7458bfc2b35f49957c6cbf107c4e3;hb=02904c3728214667f919cfe06072a91e1687b12f;hp=070cfef7dfdaf3a0590347fbf8385ce1370e3ab0;hpb=627194285d9b5354291d3a442b68b8740f114eda;p=modules%2Fgui.git diff --git a/src/SalomeApp/SalomeApp_Study.cxx b/src/SalomeApp/SalomeApp_Study.cxx index 070cfef7d..70bd944cb 100644 --- a/src/SalomeApp/SalomeApp_Study.cxx +++ b/src/SalomeApp/SalomeApp_Study.cxx @@ -41,6 +41,9 @@ #include #include #include +#include +#include +#include #include @@ -458,7 +461,22 @@ bool SalomeApp_Study::createDocument( const QString& theStr ) // initialize myStudyDS, read HDF file QString aName = newStudyName(); - _PTR(Study) study ( SalomeApp_Application::studyMgr()->NewStudy( aName.toUtf8().data() ) ); + + _PTR(Study) study; + try { + study = _PTR(Study)( SalomeApp_Application::studyMgr()->NewStudy( aName.toUtf8().data() ) ); + } + catch(const SALOME_Exception& ex) { + SUIT_MessageBox::critical( SUIT_Session::session()->activeApplication()->desktop(), + tr("ERR_ERROR"), tr(ex.what())); + return false; + } + catch(...) { + SUIT_MessageBox::critical( SUIT_Session::session()->activeApplication()->desktop(), + tr("ERR_ERROR"), tr("CREATE_DOCUMENT_PROBLEM")); + return false; + } + if ( !study ) return false; @@ -494,7 +512,21 @@ bool SalomeApp_Study::openDocument( const QString& theFileName ) MESSAGE( "openDocument" ); // initialize myStudyDS, read HDF file - _PTR(Study) study ( SalomeApp_Application::studyMgr()->Open( theFileName.toUtf8().data() ) ); + _PTR(Study) study; + try { + study = _PTR(Study) ( SalomeApp_Application::studyMgr()->Open( theFileName.toUtf8().data() ) ); + } + catch(const SALOME_Exception& ex) { + SUIT_MessageBox::critical( SUIT_Session::session()->activeApplication()->desktop(), + tr("ERR_ERROR"), tr(ex.what())); + return false; + } + catch(...) { + SUIT_MessageBox::critical( SUIT_Session::session()->activeApplication()->desktop(), + tr("ERR_ERROR"), tr("OPEN_DOCUMENT_PROBLEM")); + return false; + } + if ( !study ) return false;