From e2d357fe1b6c337fd0b57e46b2b959f34fb1e134 Mon Sep 17 00:00:00 2001 From: Renaud Barate Date: Wed, 12 May 2010 09:14:04 +0000 Subject: [PATCH] Added explicit message when an error happens in addJdcInSalome method --- src/EFICASGUI/eficasSalome.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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 -- 2.39.2