From 4a4fbfa7811c8f4e57b5cf89c876410d59f05362 Mon Sep 17 00:00:00 2001 From: Harry Jeffery Date: Mon, 28 Jul 2014 15:34:35 +0100 Subject: [PATCH] Tweak error handling in InstrumentDefinitionParser Refs #9959 --- .../src/Instrument/InstrumentDefinitionParser.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Code/Mantid/Framework/Geometry/src/Instrument/InstrumentDefinitionParser.cpp b/Code/Mantid/Framework/Geometry/src/Instrument/InstrumentDefinitionParser.cpp index 280868484254..5adefdf4e67e 100644 --- a/Code/Mantid/Framework/Geometry/src/Instrument/InstrumentDefinitionParser.cpp +++ b/Code/Mantid/Framework/Geometry/src/Instrument/InstrumentDefinitionParser.cpp @@ -1957,12 +1957,12 @@ namespace Geometry std::stringstream(id) >> detid; boost::shared_ptr detector = instrument->getDetector((detid_t) detid); - //If we didn't find anything with the detector id, just warn the user and move on. + //If we didn't find anything with the detector id, explain why to the user, and throw an exception. if(!detector) { - g_log.error() << "Error whilst loading parameters. No detector found with id '" << detid << "'. Skipping." << std::endl; + g_log.error() << "Error whilst loading parameters. No detector found with id '" << detid << "'" << std::endl; g_log.error() << "Please check that your detectors' ids are correct." << std::endl; - continue; + throw Kernel::Exception::InstrumentDefinitionError("Invalid detector id in component-link tag."); } sharedIComp.push_back(detector); @@ -1976,8 +1976,8 @@ namespace Geometry bool consistent = (comp->getFullName() == name || comp->getName() == name); if(!consistent) { - g_log.error() << "Error whilst loading parameters. Name '" << name << "' does not match id '" << detid << "'." << std::endl; - g_log.error() << "Parameters have been applied to detector with id '" << detid << "'. Please check the name is correct." << std::endl; + g_log.warning() << "Error whilst loading parameters. Name '" << name << "' does not match id '" << detid << "'." << std::endl; + g_log.warning() << "Parameters have been applied to detector with id '" << detid << "'. Please check the name is correct." << std::endl; } } }