Extension of issue #134
The calculate_distance function in the distance-based task distribution module has an issue with exception handling, leading to unexpected behavior or errors. Specifically:
ip_distance function is called to calculate distances between all IPs. However, if it raises a ValueError, the exception is ignored, which could lead to incorrect results or unexpected behavior if the distances_full variable is used later in the code.
Similarly, a KeyError exception is ignored when trying to access the distances_full dictionary, which might lead to incorrect outputs.
To solve this issue handle these exceptions more robustly, for example, by logging the exception or raising an error to alert the user that something has gone wrong.
Extension of issue #134 The
calculate_distance
function in the distance-based task distribution module has an issue with exception handling, leading to unexpected behavior or errors. Specifically:ip_distance
function is called to calculate distances between all IPs. However, if it raises aValueError
, the exception is ignored, which could lead to incorrect results or unexpected behavior if the distances_full variable is used later in the code.KeyError
exception is ignored when trying to access the distances_full dictionary, which might lead to incorrect outputs.To solve this issue handle these exceptions more robustly, for example, by logging the exception or raising an error to alert the user that something has gone wrong.