LOG("The SALOME resource manager can't be reached ==> STOP");
throw KERNEL::createSalomeException("The SALOME resource manager can't be reached");
}
+
+ _lastErrorMessage = "";
}
MeshJobManager_i::~MeshJobManager_i() {
listSteelBarMesh.push_back(currentMesh);
break;
default:
- LOG("The type of the file is not recognized");
+ _lastErrorMessage =
+ std::string("The type of the file ")+
+ std::string(currentMesh.file_name)+
+ std::string(" is not recognized");
+ LOG(_lastErrorMessage);
return JOBID_UNDEFINED;
}
}
- if ( listConcreteMesh.size() != 1 ) {
+ // It is not possible to specify more than one concrete
+ // file. Converselly, it is possible to specify no concrete file.
+ if ( listConcreteMesh.size() > 1 ) {
// Not consistent with the specification
- LOG("You specify more than one concrete mesh");
+ _lastErrorMessage = std::string("You specify more than one concrete mesh (not authorized)");
+ LOG(_lastErrorMessage);
return JOBID_UNDEFINED;
}
//const char * resourceName = "boulant@claui2p1";
//const char * resourceName = "nepal@nepal";
const char * resourceName = _configMap[configId].resname;
- Engines::ResourceDefinition * resourceDefinition = _resourcesManager->GetResourceDefinition(resourceName);
+
+ Engines::ResourceDefinition * resourceDefinition;
+ try {
+ resourceDefinition = _resourcesManager->GetResourceDefinition(resourceName);
+ }
+ catch (const CORBA::SystemException& ex) {
+ _lastErrorMessage = std::string("We can not access to the ressource ") + std::string(resourceName);
+ _lastErrorMessage+= std::string("(check the file CatalogResource.xml)");
+ LOG(_lastErrorMessage);
+ return JOBID_UNDEFINED;
+ }
// CAUTION: This resource should have been defined in the
// CatalogResource.xml associated to the SALOME application.
//
//
// So, even in the case of a simple test shell script, you should
// set this value at least to a standard threshold as 500MB
-
int jobId = JOBID_UNDEFINED;
try {
- std::cerr << "#####################################" << std::endl;
- std::cerr << "#####################################" << std::endl;
- std::cerr << "jobUndef = " << JOBID_UNDEFINED << std::endl;
jobId = _salomeLauncher->createJob(jobParameters);
- std::cerr << "#####################################" << std::endl;
- std::cerr << "#####################################" << std::endl;
- std::cerr << "#####################################" << std::endl;
- std::cerr << "jobId = " << jobId << std::endl;
// We register the datetime tag of this job
_jobDateTimeMap[jobId]=jobDatetimeTag;
_jobPathsMap[jobId] = jobPaths;
}
catch (const SALOME::SALOME_Exception & ex) {
- LOG("SALOME Exception in createJob !" <<ex.details.text.in());
- //LOG(ex.details.text.in());
+ LOG("SALOME Exception at initialization step !" <<ex.details.text.in());
+ _lastErrorMessage = ex.details.text.in();
return JOBID_UNDEFINED;
}
catch (const CORBA::SystemException& ex) {
LOG("Receive SALOME System Exception: "<<ex);
LOG("Check SALOME servers...");
+ _lastErrorMessage = "Check the SALOME servers (or try to restart SALOME)";
return JOBID_UNDEFINED;
}
}
catch (const SALOME::SALOME_Exception & ex) {
LOG("SALOME Exception in launchjob !" <<ex.details.text.in());
- //LOG(ex.details.text.in());
+ _lastErrorMessage = ex.details.text.in();
return false;
}
catch (const CORBA::SystemException& ex) {
LOG("Receive SALOME System Exception: "<<ex);
LOG("Check SALOME servers...");
+ _lastErrorMessage = "Check the SALOME servers (or try to restart SALOME)";
return false;
}
catch (const SALOME::SALOME_Exception & ex)
{
LOG("SALOME Exception in getJobState !");
+ _lastErrorMessage = ex.details.text.in();
state = ex.details.text;
}
catch (const CORBA::SystemException& ex)
{
LOG("SALOME Exception in getResults !");
result->status = "SALOME Exception in getResults !";
+ _lastErrorMessage = ex.details.text.in();
}
catch (const CORBA::SystemException& ex)
{
return resourceNames;
}
+char* MeshJobManager_i::getLastErrorMessage() {
+ beginService("MeshJobManager_i::getState");
+ endService("MeshJobManager_i::getState");
+ return CORBA::string_dup(_lastErrorMessage.c_str());
+}
//
// ==========================================================================