Skip to content

Commit

Permalink
Don't stop node when failed to load parameter overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
bjsowa committed Nov 9, 2023
1 parent 230b288 commit 5981eb4
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions leo_fw/leo_fw/nodes/parameter_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,7 @@ def load_default_params(self) -> None:
)

with open(default_params_file, "r", encoding="utf-8") as file:
try:
self.default_params: dict = yaml.safe_load(file)
except yaml.YAMLError as exc:
self.get_logger().error(exc)
raise
self.default_params: dict = yaml.safe_load(file)

def load_override_params(self) -> None:
override_params_file: str = (
Expand All @@ -124,12 +120,12 @@ def load_override_params(self) -> None:
)

if override_params_file != "":
with open(override_params_file, "r", encoding="utf-8") as file:
try:
try:
with open(override_params_file, "r", encoding="utf-8") as file:
self.override_params: dict = yaml.safe_load(file)
except yaml.YAMLError as exc:
self.get_logger().error(exc)
raise
except (FileNotFoundError, PermissionError, yaml.YAMLError) as exc:
self.get_logger().error("Failed to load parameter overrides!")
self.get_logger().error(str(exc))
else:
self.override_params = {}
self.get_logger().warning("Path to file with override parameters is empty.")
Expand Down

0 comments on commit 5981eb4

Please sign in to comment.