Skip to content

Commit

Permalink
Deal with the situation when ws doesn't contain any auto-grouping info.
Browse files Browse the repository at this point in the history
Plus improve other error messages.

Refs #7229
  • Loading branch information
arturbekasov committed Oct 14, 2013
1 parent ea460e2 commit a58edd5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
19 changes: 14 additions & 5 deletions Code/Mantid/Framework/Algorithms/src/PlotAsymmetryByLogValue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ namespace Mantid

deadTimeWs = loadDeadTimes->getProperty("OutputWorkspace");
}
catch(std::exception& e)
catch(...)
{
throw std::runtime_error("Unable to load Dead Time Table from the file\n" + std::string(e.what()));
throw std::runtime_error("Unable to load Dead Time Table from the file. Please use correct file or set Deat Time Correction to None");
}
}

Expand Down Expand Up @@ -275,9 +275,9 @@ namespace Mantid
{
loadedWs = applyDeadTimeCorrection(deadTimeWs, loadedWs);
}
catch(std::exception& e)
catch(...)
{
throw std::runtime_error("Unable to apply Dead Time correction\n" + std::string(e.what()) );
throw std::runtime_error("Unable to apply Dead Time correction. Please change the Dead Time Table used or set Deat Time Correction to None");
}
}

Expand All @@ -287,7 +287,16 @@ namespace Mantid
applyGrouping->initialize();
applyGrouping->setProperty("InputWorkspace", loadedWs);
applyGrouping->setPropertyValue("Filename", fn.str());
applyGrouping->execute();

try
{
applyGrouping->execute();
}
catch(...)
{
throw std::runtime_error("Unable to auto-group the workspace. Please specify grouping manually");
}

loadedWs = applyGrouping->getProperty("OutputWorkspace");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ namespace DataHandling
groups[group].push_back(static_cast<detid_t>(i));
}

if(groups.empty())
throw std::invalid_argument("No groups specified in the input file");

// Number of the last group we've met
int lastGroup = groups.rbegin()->first;

Expand Down

0 comments on commit a58edd5

Please sign in to comment.