From b8a546c91fd42b08cea4f8e92631ab51362a51a6 Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 15 May 2019 16:40:17 +0300 Subject: [PATCH] #16866: [CEA 13186] smesh Exception during hypothesis creation Show more information on error occurred. --- src/SMESH_I/SMESH_Gen_i.cxx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index cf7d6a591..09ea4c2fe 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -462,9 +462,10 @@ GenericHypothesisCreator_i* SMESH_Gen_i::getHypothesisCreator(const char* theHyp // report any error, if occurred #ifndef WIN32 const char* anError = dlerror(); - throw(SALOME_Exception(anError)); + throw(SALOME_Exception( anError )); #else - throw(SALOME_Exception(LOCALIZED( "Can't load server meshers plugin library" ))); + throw(SALOME_Exception ( SMESH_Comment("Can't load meshers plugin library " ) + << aPlatformLibName)); #endif } @@ -474,7 +475,8 @@ GenericHypothesisCreator_i* SMESH_Gen_i::getHypothesisCreator(const char* theHyp (GetHypothesisCreator)GetProc( libHandle, "GetHypothesisCreator" ); if (!procHandle) { - throw(SALOME_Exception(LOCALIZED("bad hypothesis plugin library"))); + throw(SALOME_Exception(SMESH_Comment("bad hypothesis plugin library") + << aPlatformLibName )); UnLoadLib(libHandle); } @@ -483,7 +485,8 @@ GenericHypothesisCreator_i* SMESH_Gen_i::getHypothesisCreator(const char* theHyp aCreator = procHandle(theHypName); if (!aCreator) { - throw(SALOME_Exception(LOCALIZED("no such a hypothesis in this plugin"))); + throw(SALOME_Exception( SMESH_Comment( theHypName ) << " is missing from " + << aPlatformLibName)); } // map hypothesis creator to a hypothesis name myHypCreatorMap[string(theHypName)] = aCreator; @@ -5218,6 +5221,10 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent, try { // protect persistence mechanism against exceptions myHyp = this->createHypothesis( hypname.c_str(), libname.c_str() ); } + catch( SALOME::SALOME_Exception& ex ) + { + INFOS( "Exception during hypothesis creation: " << ex.details.text ); + } catch (...) { INFOS( "Exception during hypothesis creation" ); } -- 2.30.2