diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-06-06 14:32:09 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-06-06 14:56:28 +0100 |
commit | 67b4b34cce4abf745b24c858d533a25c291b5093 (patch) | |
tree | 58ef54b8336f6e9ceae7731f39ed5824d989b06b /sccomp | |
parent | 735cd3407856e0a6572eb6bbd402187dda2cdff4 (diff) |
coverity#1202902 Uncaught CoinError exception
Change-Id: I93488fa942f1975b9c32be6d37fc76ea955a2067
Diffstat (limited to 'sccomp')
-rw-r--r-- | sccomp/source/solver/CoinMPSolver.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
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 <CoinMP.h> +#include <CoinError.hpp> #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 ) |