diff --git a/Framework/DataHandling/src/LoadEventNexus.cpp b/Framework/DataHandling/src/LoadEventNexus.cpp index 330b3d6ae06cf9c6182b0c0406972653141f777e..ca13f840d310eac26057cb0470547679c874b69a 100644 --- a/Framework/DataHandling/src/LoadEventNexus.cpp +++ b/Framework/DataHandling/src/LoadEventNexus.cpp @@ -1074,6 +1074,11 @@ void LoadEventNexus::init() { "The name of the output EventWorkspace or WorkspaceGroup in which to " "load the EventNexus file."); + declareProperty( + make_unique<PropertyWithValue<string>>("NXentryName", "", + Direction::Input), + "Optional: Name of the NXentry to load if it's not the default."); + declareProperty(make_unique<PropertyWithValue<double>>( "FilterByTofMin", EMPTY_DBL(), Direction::Input), "Optional: To exclude events that do not fall within a range " @@ -1104,11 +1109,6 @@ void LoadEventNexus::init() { setPropertyGroup("FilterByTimeStart", grp1); setPropertyGroup("FilterByTimeStop", grp1); - declareProperty( - make_unique<PropertyWithValue<string>>("NXentryName", "", - Direction::Input), - "Optional: Name of the NXentry to load if it's not the default."); - declareProperty( make_unique<ArrayProperty<string>>("BankName", Direction::Input), "Optional: To only include events from one bank. Any bank " diff --git a/Framework/DataHandling/src/LoadNexusLogs.cpp b/Framework/DataHandling/src/LoadNexusLogs.cpp index 3e79c4ae0dc6ec4f4c7e853b9aa8e40c39ce205c..b62af9405ae2c3dceb690f7ee0f8027b4874c277 100644 --- a/Framework/DataHandling/src/LoadNexusLogs.cpp +++ b/Framework/DataHandling/src/LoadNexusLogs.cpp @@ -121,7 +121,7 @@ void LoadNexusLogs::exec() { file.openGroup(entry_name, "NXentry"); } catch (::NeXus::Exception &) { throw std::invalid_argument("Unknown NeXus file format found in file '" + - filename + "'"); + filename + "', or '" + entry_name + "' is not a valid NXentry"); } /// Use frequency start for Monitor19 and Special1_19 logs with "No Time" for diff --git a/Framework/WorkflowAlgorithms/src/RefReduction.cpp b/Framework/WorkflowAlgorithms/src/RefReduction.cpp index 69781351212e9f3fff2d04d56cf1ee500ff30569..bd4d93edcefbb28a05af5afd680d51e0a298844b 100644 --- a/Framework/WorkflowAlgorithms/src/RefReduction.cpp +++ b/Framework/WorkflowAlgorithms/src/RefReduction.cpp @@ -139,6 +139,10 @@ MatrixWorkspace_sptr RefReduction::processData(const std::string polarization) { m_output_message += "Processing " + polarization + '\n'; const std::string dataRun = getPropertyValue("DataRun"); IEventWorkspace_sptr evtWS = loadData(dataRun, polarization); + // wrong entry name + if (!evtWS) { + return nullptr; + } MatrixWorkspace_sptr dataWS = boost::dynamic_pointer_cast<MatrixWorkspace>(evtWS); MatrixWorkspace_sptr dataWSTof = @@ -503,7 +507,13 @@ IEventWorkspace_sptr RefReduction::loadData(const std::string dataRun, loadAlg->setProperty("Filename", path); if (polarization.compare(PolStateNone) != 0) loadAlg->setProperty("NXentryName", polarization); - loadAlg->executeAsChildAlg(); + try { + loadAlg->executeAsChildAlg(); + } catch (...) { + g_log.notice() << "Could not load polarization " << polarization; + return nullptr; + } + Workspace_sptr temp = loadAlg->getProperty("OutputWorkspace"); rawWS = boost::dynamic_pointer_cast<IEventWorkspace>(temp); if (rawWS->getNumberEvents() == 0) {