[Positioning] Positioning: catch compute exceptions
Catch the exception potentially thrown by PositioningAlgorithm::compute().
This commit is contained in:
parent
0df91eaa94
commit
d43267fcd3
|
@ -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) ;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue