]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Fix for the "22595: [CEA 1177] Misleading error message" issue.
authorrnv <rnv@opencascade.com>
Fri, 23 May 2014 08:42:12 +0000 (12:42 +0400)
committerrnv <rnv@opencascade.com>
Fri, 23 May 2014 08:42:12 +0000 (12:42 +0400)
src/SalomeApp/SalomeApp_Study.cxx
src/SalomeApp/resources/SalomeApp_msg_en.ts

index 8bb0ee1785f29051cf0edeef6a67985afe47884c..70bd944cbdf7458bfc2b35f49957c6cbf107c4e3 100644 (file)
@@ -466,10 +466,17 @@ bool SalomeApp_Study::createDocument( const QString& theStr )
   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("ERR_ACTIVE_STUDY_CREATE") );
+                               tr("ERR_ERROR"), tr("CREATE_DOCUMENT_PROBLEM"));
+    return false;
   }
+
   if ( !study )
     return false;
 
@@ -509,10 +516,17 @@ bool SalomeApp_Study::openDocument( const QString& theFileName )
   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("ERR_ACTIVE_STUDY_OPEN") );
+                               tr("ERR_ERROR"), tr("OPEN_DOCUMENT_PROBLEM"));
+    return false;
   }
+
   if ( !study )
     return false;
 
index 16e1ae5b53a3f6aa8348641c46e91874daaa5f64..af08eef16692b0bf42dfe1cb6a040092c4d38cc8 100644 (file)
@@ -110,6 +110,14 @@ Launch a new session or close the study.</translation>
         <translation>Cannot open study: there is already an active study in this session.
 Launch a new session or close the study.</translation>
     </message>
+    <message>
+        <source>OPEN_DOCUMENT_PROBLEM</source>
+        <translation>Unknown problem during opening of the document</translation>
+    </message>
+    <message>
+        <source>CREATE_DOCUMENT_PROBLEM</source>
+        <translation>Unknown problem during creation of the document</translation>
+    </message>
 </context>
 <context>
     <name>SalomeApp_Application</name>