diff --git a/owlps-positioning/src/positioning.cc b/owlps-positioning/src/positioning.cc index 38480e0..0e94cd9 100644 --- a/owlps-positioning/src/positioning.cc +++ b/owlps-positioning/src/positioning.cc @@ -97,7 +97,21 @@ void Positioning::loop() for (algo = algorithms.begin() ; algo != algorithms.end() ; ++algo) { - Result res((*algo)->compute(request)) ; + Result res ; + + try + { + res = (*algo)->compute(request) ; + } + catch (exception &e) + { + cerr + << "Cannot compute with algorithm " + << (*algo)->get_name() << ": « " + << e.what() << " »\n" ; + continue ; + } + if (compute_error) res.compute_error(real_position) ; else if ((*algo)->get_name() == "Real") @@ -105,6 +119,7 @@ void Positioning::loop() compute_error = true ; real_position = res.get_position() ; } + results.add(res) ; }