diff --git a/Framework/Kernel/src/ConfigService.cpp b/Framework/Kernel/src/ConfigService.cpp index f4cefcdd3cb605ea8cb99d419904e9e17ae91890..fc97ecc67f977329b035fe88c83974a894a7b293 100644 --- a/Framework/Kernel/src/ConfigService.cpp +++ b/Framework/Kernel/src/ConfigService.cpp @@ -1780,7 +1780,7 @@ ConfigServiceImpl::getFacilityFilenames(const std::string &fName) { p.append("Facilities.xml"); std::string filename = p.toString(); Poco::File fileObj(filename); - // stop when you find the first one + if (fileObj.exists()) returnPaths.push_back(filename); } @@ -1857,10 +1857,14 @@ void ConfigServiceImpl::updateFacilities(const std::string &fName) { attemptIndex++; // move on to the next file index if available if (attemptIndex == fileNames.size()) { - // Throw an exception as we have run out of files to try - throw std::runtime_error( + std::string errorMessage = "No more Facilities.xml files can be found, Mantid will not be " - "able to start, Sorry. Try reinstalling Mantid."); + "able to start, Sorry. Try reinstalling Mantid."; + //This is one of the few times that both logging a messge and throwing might make sense + // as the error reporter tends to swallow the thrown message. + g_log.error() << errorMessage << "\n"; + // Throw an exception as we have run out of files to try + throw std::runtime_error(errorMessage); } } } diff --git a/docs/source/release/v4.2.0/framework.rst b/docs/source/release/v4.2.0/framework.rst index 6d5185ece9a6a4de32ba9051677e5f5ae688cefb..4d349c0f8cf026f9763a4e3c40ed0a9f298be330 100644 --- a/docs/source/release/v4.2.0/framework.rst +++ b/docs/source/release/v4.2.0/framework.rst @@ -35,7 +35,7 @@ Algorithms Instrument Definition Files --------------------------- -* Mantid is now resilient to corrupted Facilities.xml files, which could sometimes happen occaisionally while downloading an updated file. If Mantid finds a corrupt file it will now fall back to the originally installed file, an the corrupted one should be re-downloaded. +* Mantid is now resilient to corrupted Facilities.xml files, which could sometimes happen occasionally while downloading an updated file. If Mantid finds a corrupt file it will now fall back to the originally installed file, and the corrupted one should be re-downloaded. * A definition file for the NEAT instrument at HZB as been added along with an entry in the facilities file. Data Objects