diff --git a/Code/Mantid/Framework/ICat/inc/MantidICat/CatalogDownloadDataFiles.h b/Code/Mantid/Framework/ICat/inc/MantidICat/CatalogDownloadDataFiles.h index 27b97c90f04d..013a3b0631fc 100644 --- a/Code/Mantid/Framework/ICat/inc/MantidICat/CatalogDownloadDataFiles.h +++ b/Code/Mantid/Framework/ICat/inc/MantidICat/CatalogDownloadDataFiles.h @@ -72,6 +72,8 @@ namespace Mantid std::string testDownload(const std::string& URL,const std::string& fileName); private: + /// Throw a catalog error. + void throwCatalogError() const; /// Sets documentation strings for this algorithm virtual void initDocs(); /// Overwrites Algorithm method. diff --git a/Code/Mantid/Framework/ICat/inc/MantidICat/CatalogLogin.h b/Code/Mantid/Framework/ICat/inc/MantidICat/CatalogLogin.h index a03d8c9013ca..c6022fdf4d0c 100644 --- a/Code/Mantid/Framework/ICat/inc/MantidICat/CatalogLogin.h +++ b/Code/Mantid/Framework/ICat/inc/MantidICat/CatalogLogin.h @@ -54,6 +54,7 @@ namespace Mantid virtual const std::string category() const { return "DataHandling\\Catalog"; } private: + void throwCatalogError() const; /// Sets documentation strings for this algorithm virtual void initDocs(); /// Overwrites Algorithm method. diff --git a/Code/Mantid/Framework/ICat/src/CatalogDownloadDataFiles.cpp b/Code/Mantid/Framework/ICat/src/CatalogDownloadDataFiles.cpp index e323ebb301d5..1c1570f44bbe 100644 --- a/Code/Mantid/Framework/ICat/src/CatalogDownloadDataFiles.cpp +++ b/Code/Mantid/Framework/ICat/src/CatalogDownloadDataFiles.cpp @@ -64,6 +64,18 @@ namespace Mantid Direction::Output), "A list of containing locations of files downloaded from data server"); } + + /// Raise an error concerning catalog searching + void CatalogDownloadDataFiles::throwCatalogError() const + { + const std::string facilityName = ConfigService::Instance().getFacility().name(); + std::stringstream ss; + ss << "Your current Facility, " << facilityName << ", does not have ICAT catalog information. " + << std::endl; + ss << "The facilities.xml file may need updating. Contact the Mantid Team for help." << std::endl; + throw std::runtime_error(ss.str()); + } + /// Execute the algorithm void CatalogDownloadDataFiles::exec() { @@ -76,11 +88,11 @@ namespace Mantid } catch(Kernel::Exception::NotFoundError&) { - throw std::runtime_error("Error when getting the catalog information from the Facilities.xml file."); + throwCatalogError(); } if(!catalog_sptr) { - throw std::runtime_error("Error when getting the catalog information from the Facilities.xml file"); + throwCatalogError(); } //get file ids std::vector fileids = getProperty("FileIds"); diff --git a/Code/Mantid/Framework/ICat/src/CatalogLogin.cpp b/Code/Mantid/Framework/ICat/src/CatalogLogin.cpp index 7ab21b29aa37..714ddf782098 100644 --- a/Code/Mantid/Framework/ICat/src/CatalogLogin.cpp +++ b/Code/Mantid/Framework/ICat/src/CatalogLogin.cpp @@ -52,16 +52,27 @@ namespace Mantid } catch(Kernel::Exception::NotFoundError&) { - throw std::runtime_error("Error when getting the catalog information from the Facilities.xml file."); + throwCatalogError(); } if(!catalog_sptr) { - throw std::runtime_error("Error when getting the catalog information from the Facilities.xml file"); + throwCatalogError(); } catalog_sptr->login(username,password,""); } + /// Raise an error concerning catalog searching + void CatalogLogin::throwCatalogError() const + { + const std::string facilityName = ConfigService::Instance().getFacility().name(); + std::stringstream ss; + ss << "Your current Facility, " << facilityName << ", does not have ICAT catalog information. " + << std::endl; + ss << "The facilities.xml file may need updating. Contact the Mantid Team for help." << std::endl; + throw std::runtime_error(ss.str()); + } + } } diff --git a/Code/Mantid/Framework/ICat/src/CatalogSearch.cpp b/Code/Mantid/Framework/ICat/src/CatalogSearch.cpp index ec19f03293fc..7564a6c018a7 100644 --- a/Code/Mantid/Framework/ICat/src/CatalogSearch.cpp +++ b/Code/Mantid/Framework/ICat/src/CatalogSearch.cpp @@ -72,7 +72,11 @@ namespace Mantid } catch(Kernel::Exception::NotFoundError&) { - throw std::runtime_error("Error when getting the catalog information from the Facilities.xml file."); + std::string facilityName = ConfigService::Instance().getFacility().name(); + std::stringstream ss; + ss << "Your current Facility: " << facilityName << " does not have ICAT catalog information. " << std::endl; + ss << "The facilities.xml file may need updating. Contact the Mantid Team for help." << std::endl; + throw std::runtime_error(ss.str()); } if(!catalog_sptr) { diff --git a/Code/Mantid/instrument/Facilities.xml b/Code/Mantid/instrument/Facilities.xml index 7ec2460ef7a9..e44da0832b56 100644 --- a/Code/Mantid/instrument/Facilities.xml +++ b/Code/Mantid/instrument/Facilities.xml @@ -219,9 +219,6 @@ - - - Triple Axis Spectroscopy @@ -266,17 +263,6 @@ - - - - - - - - - - - technique