Skip to content

Commit

Permalink
Included a catch all in algorithm runner
Browse files Browse the repository at this point in the history
Should ensure that unit tests cannot hang if starting an algorithm
throws a non standard exception

Refs #10092
  • Loading branch information
DanNixon committed Aug 13, 2014
1 parent b7d3c07 commit 4be794b
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions Code/Mantid/MantidQt/API/src/BatchAlgorithmRunner.cpp
Expand Up @@ -58,6 +58,8 @@ namespace API
*/
void BatchAlgorithmRunner::cancelAll()
{
m_isExecuting = false;

// Clear queue
m_algorithms.clear();

Expand All @@ -66,8 +68,6 @@ namespace API
{
cancelRunningAlgorithm();
}

m_isExecuting = false;
}

/**
Expand Down Expand Up @@ -164,7 +164,7 @@ namespace API

g_log.warning("Algorithm property does not exist.\nStopping queue execution.");

m_isExecuting = false;
cancelAll();
emit batchComplete(true);
}
// If a property was assigned a value of the wrong type
Expand All @@ -174,7 +174,16 @@ namespace API

g_log.warning("Algorithm property given value of incorrect type.\nStopping queue execution.");

m_isExecuting = false;
cancelAll();
emit batchComplete(true);
}
catch(std::exception &exc)
{
UNUSED_ARG(exc);

g_log.warning("Unknown error starting next batch algorithm");

cancelAll();
emit batchComplete(true);
}
}
Expand Down

0 comments on commit 4be794b

Please sign in to comment.