From 4cbde2749db74dcef916b56326b2efb119de7628 Mon Sep 17 00:00:00 2001 From: James Pace Date: Sat, 22 Nov 2025 12:35:08 -0500 Subject: [PATCH] Cleanup error handling. --- am_i_up/am_i_up.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/am_i_up/am_i_up.py b/am_i_up/am_i_up.py index 01c48b0..4206456 100644 --- a/am_i_up/am_i_up.py +++ b/am_i_up/am_i_up.py @@ -38,7 +38,8 @@ class Facts: build_info_getter_directory = None try: build_info_getter_directory = get_package_share_directory('build_info_getter') - except: + except Exception as e: + print("Can't find build info.\n{}".format(e)) return None # Find and read the project_state.repos file in it. project_state_file = build_info_getter_directory + "/project_state.repos" @@ -46,11 +47,10 @@ class Facts: try: with open(project_state_file, 'r') as file_obj: project_state_content = yaml.safe_load(file_obj) - except: + except Exception as e: # We either didn't load the file or couldn't read it # as json. - # If we ignore the error, we'll respond with a None which is the right thing. - pass + print("Can't find build info.\n{}".format(e)) return project_state_content class Routes: