Replace exceptions with 'if' statement

This commit is contained in:
Raffson 2022-07-04 17:23:29 +02:00 committed by Dan Albert
parent 64e68706ad
commit ec425501cd

View File

@ -220,9 +220,9 @@ class IadsNetwork:
f"IADS: No ground object found for {element_name}." f"IADS: No ground object found for {element_name}."
f" This can be normal behaviour." f" This can be normal behaviour."
) )
try: if element_name in self.ground_objects:
node = self.node_for_tgo(self.ground_objects[element_name]) node = self.node_for_tgo(self.ground_objects[element_name])
except KeyError: else:
node = None node = None
warning_msg = ( warning_msg = (
f"IADS: No ground object found for connection {element_name}" f"IADS: No ground object found for connection {element_name}"