Salome HOME
Merge branch 'omu/update_doc_77'
[modules/yacs.git] / src / genericgui / GuiExecutor.cxx
index c6f35d50c736dad020a11fc2d549b13c647bd9f5..4bd977c69451a22148d5ac76b68957558d519ee6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2014  CEA/DEN, EDF R&D
+// Copyright (C) 2006-2015  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -279,8 +279,12 @@ void GuiExecutor::saveState(const std::string& xmlFile)
   bool StartFinish = (getExecutorState() == YACS::NOTYETINITIALIZED ||
                       getExecutorState() == YACS::FINISHED);
   if ( _isRunning ||
-       !(CORBA::is_nil(_procRef)) && StartFinish )
-    _procRef->saveState(xmlFile.c_str());
+       !(CORBA::is_nil(_procRef)) && StartFinish ) {
+    if ( !_procRef->saveState(xmlFile.c_str()) ) {
+      string what = "Impossible to open file for writing: " + xmlFile;
+      throw Exception(what);
+    }
+  }
 }
 
 void GuiExecutor::setLoadStateFile(std::string xmlFile)