From: Renaud Barate Date: Wed, 12 May 2010 09:14:04 +0000 (+0000) Subject: Added explicit message when an error happens in addJdcInSalome method X-Git-Tag: V5_1_4~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e2d357fe1b6c337fd0b57e46b2b959f34fb1e134;p=modules%2Feficas.git Added explicit message when an error happens in addJdcInSalome method --- diff --git a/src/EFICASGUI/eficasSalome.py b/src/EFICASGUI/eficasSalome.py index a608842d..e28d2d89 100644 --- a/src/EFICASGUI/eficasSalome.py +++ b/src/EFICASGUI/eficasSalome.py @@ -2,6 +2,7 @@ #_____________________________________ import sys, os, re,types +from PyQt4.QtGui import QMessageBox from pal.logger import ExtLogger logger=ExtLogger( "EFICAS_SRC.EFICASGUI.eficasSalome.py" ) @@ -406,8 +407,7 @@ class MyEficas( qtEficas.Appli ): """ msgError = "Erreur dans l'export du fichier de commande dans l'arbre d'etude Salome" ok = False - #try: - if 1: + try: atLeastOneStudy = self.editor.study if not atLeastOneStudy: return ok, msgError @@ -455,8 +455,12 @@ class MyEficas( qtEficas.Appli ): #print 'addJdcInSalome commEntry->', commEntry if commEntry: ok, msgError = True, '' - #except: - # logger.debug(50*'=' Erreur au AddJDC) + except Exception, exc: + msgError = "Can't add Eficas file to Salome study tree" + logger.exception(msgError) + QMessageBox.warning(self, self.tr("Warning"), + self.tr("%s. Reason:\n%s\n\nSee logs for " + "more details." % (msgError, exc))) return ok, msgError