#16866: [CEA 13186] smesh Exception during hypothesis creation

Show more information on error occurred.
This commit is contained in:
eap 2019-05-15 16:40:17 +03:00
parent 17fe9ed25b
commit b8a546c91f

View File

@ -462,9 +462,10 @@ GenericHypothesisCreator_i* SMESH_Gen_i::getHypothesisCreator(const char* theHyp
// report any error, if occurred // report any error, if occurred
#ifndef WIN32 #ifndef WIN32
const char* anError = dlerror(); const char* anError = dlerror();
throw(SALOME_Exception(anError)); throw(SALOME_Exception( anError ));
#else #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 #endif
} }
@ -474,7 +475,8 @@ GenericHypothesisCreator_i* SMESH_Gen_i::getHypothesisCreator(const char* theHyp
(GetHypothesisCreator)GetProc( libHandle, "GetHypothesisCreator" ); (GetHypothesisCreator)GetProc( libHandle, "GetHypothesisCreator" );
if (!procHandle) if (!procHandle)
{ {
throw(SALOME_Exception(LOCALIZED("bad hypothesis plugin library"))); throw(SALOME_Exception(SMESH_Comment("bad hypothesis plugin library")
<< aPlatformLibName ));
UnLoadLib(libHandle); UnLoadLib(libHandle);
} }
@ -483,7 +485,8 @@ GenericHypothesisCreator_i* SMESH_Gen_i::getHypothesisCreator(const char* theHyp
aCreator = procHandle(theHypName); aCreator = procHandle(theHypName);
if (!aCreator) 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 // map hypothesis creator to a hypothesis name
myHypCreatorMap[string(theHypName)] = aCreator; myHypCreatorMap[string(theHypName)] = aCreator;
@ -5218,6 +5221,10 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
try { // protect persistence mechanism against exceptions try { // protect persistence mechanism against exceptions
myHyp = this->createHypothesis( hypname.c_str(), libname.c_str() ); myHyp = this->createHypothesis( hypname.c_str(), libname.c_str() );
} }
catch( SALOME::SALOME_Exception& ex )
{
INFOS( "Exception during hypothesis creation: " << ex.details.text );
}
catch (...) { catch (...) {
INFOS( "Exception during hypothesis creation" ); INFOS( "Exception during hypothesis creation" );
} }