From dbda5b1ed339d55fad47ce7f650b9096eb883260 Mon Sep 17 00:00:00 2001 From: Arturs Bekasovs Date: Tue, 11 Mar 2014 11:55:56 +0000 Subject: [PATCH] Refs #9129. Append original exception message --- Code/Mantid/Framework/API/src/Algorithm.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Code/Mantid/Framework/API/src/Algorithm.cpp b/Code/Mantid/Framework/API/src/Algorithm.cpp index 800f78aff5e6..bb8ff78c1c73 100644 --- a/Code/Mantid/Framework/API/src/Algorithm.cpp +++ b/Code/Mantid/Framework/API/src/Algorithm.cpp @@ -1247,6 +1247,8 @@ namespace Mantid // Don't make the new algorithm a child so that it's workspaces are stored correctly alg_sptr->setChild(false); + alg_sptr->setRethrows(true); + IAlgorithm* alg = alg_sptr.get(); // Set all non-workspace properties this->copyNonWorkspaceProperties(alg, int(entry)+1); @@ -1298,8 +1300,17 @@ namespace Mantid } // for each OutputWorkspace property // ------------ Execute the algo -------------- - if (!alg->execute()) - throw std::runtime_error("Execution of " + this->name() + " for group entry " + Strings::toString(entry+1) + " failed."); + try + { + alg->execute(); + } + catch(std::exception& e) + { + std::ostringstream msg; + msg << "Execution of " << this->name() << " for group entry " << (entry+1) << " failed: "; + msg << e.what(); // Add original message + throw std::runtime_error(msg.str()); + } // ------------ Fill in the output workspace group ------------------ // this has to be done after execute() because a workspace must exist