From 67b4b34cce4abf745b24c858d533a25c291b5093 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 6 Jun 2014 14:32:09 +0100 Subject: coverity#1202902 Uncaught CoinError exception Change-Id: I93488fa942f1975b9c32be6d37fc76ea955a2067 --- sccomp/source/solver/CoinMPSolver.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'sccomp/source/solver/CoinMPSolver.cxx') diff --git a/sccomp/source/solver/CoinMPSolver.cxx b/sccomp/source/solver/CoinMPSolver.cxx index f1ee10b40b80..7a016b154220 100644 --- a/sccomp/source/solver/CoinMPSolver.cxx +++ b/sccomp/source/solver/CoinMPSolver.cxx @@ -18,6 +18,7 @@ */ #include +#include #include "SolverComponent.hxx" #include "solver.hrc" @@ -313,7 +314,15 @@ void SAL_CALL CoinMPSolver::solve() throw(uno::RuntimeException, std::exception) // solve model nResult = CoinCheckProblem( hProb ); - nResult = CoinOptimizeProblem( hProb, 0 ); + + try + { + nResult = CoinOptimizeProblem( hProb, 0 ); + } + catch (const CoinError& e) + { + throw std::runtime_error(e.message()); + } mbSuccess = ( nResult == SOLV_CALL_SUCCESS ); if ( mbSuccess ) -- cgit