Skip to content

Commit

Permalink
Add error handling in get_node_info() method
Browse files Browse the repository at this point in the history
  • Loading branch information
pawelirh committed Sep 13, 2024
1 parent ffc4fe6 commit 962719b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions panther_utils/panther_utils/integration_test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ def get_node_info(node_name: str) -> ROSNodeInfo:
Returns:
ROSNodeInfo: An object representing a complete node info.
Raises:
RuntimeError: If the command execution fails.
"""
node_info = ROSNodeInfo()

Expand Down Expand Up @@ -73,7 +76,6 @@ def get_node_info(node_name: str) -> ROSNodeInfo:
current_section = None

except subprocess.CalledProcessError as e:
print(f"Error executing command: {e}")
print(f"stderr: {e.stderr}")
raise RuntimeError(f"Error executing command: {e}. stderr: {e.stderr}") from e

return node_info

0 comments on commit 962719b

Please sign in to comment.