diff --git a/Framework/API/src/FileFinder.cpp b/Framework/API/src/FileFinder.cpp index f3f810c6ed91..b5ddc20e5fee 100644 --- a/Framework/API/src/FileFinder.cpp +++ b/Framework/API/src/FileFinder.cpp @@ -32,6 +32,7 @@ #include #include +#include namespace { /// static logger object @@ -668,6 +669,11 @@ FileFinderImpl::getISISInstrumentDataCachePath(const std::string &cachePathToSea } catch (const std::invalid_argument &e) { errors += "Data cache: " + std::string(e.what()); return API::Result("", errors); + + } catch (const Json::Exception &e) { + errors += "Data cache: Failed parsing to JSON: " + std::string(e.what()) + + "Error likely due to accessing instrument index file while it was being updated on IDAaaS."; + return API::Result("", errors); } if (!std::filesystem::exists(parentDirPath)) { diff --git a/Framework/API/src/ISISInstrumentDataCache.cpp b/Framework/API/src/ISISInstrumentDataCache.cpp index 2ffcc85a81c8..726f9ec3fb89 100644 --- a/Framework/API/src/ISISInstrumentDataCache.cpp +++ b/Framework/API/src/ISISInstrumentDataCache.cpp @@ -21,7 +21,7 @@ std::string Mantid::API::ISISInstrumentDataCache::getFileParentDirectoryPath(std std::string jsonPath = m_dataCachePath + "/" + instrName + "/" + instrName + "_index.json"; std::ifstream ifstrm{jsonPath}; if (!ifstrm) { - throw std::invalid_argument("Error opennig instrument index file: " + jsonPath); + throw std::invalid_argument("Could not open index file: " + jsonPath); } // Read directory path from json file