Skip to content

Commit

Permalink
Refs #9129. Append original exception message
Browse files Browse the repository at this point in the history
  • Loading branch information
arturbekasov committed Mar 11, 2014
1 parent 90e6723 commit dbda5b1
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions Code/Mantid/Framework/API/src/Algorithm.cpp
Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit dbda5b1

Please sign in to comment.