Skip to content

Commit

Permalink
Handle KeyErrors separately
Browse files Browse the repository at this point in the history
  • Loading branch information
civerachb-cpr committed Sep 12, 2024
1 parent 72f04a3 commit 6519d9b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions turtlebot4_setup/ros_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,8 @@ def install(self):

self.daemon_reload()

except KeyError as err:
ErrorPrompt(f'Failed to install systemd job:\n{err} is not defined').show()
except Exception as err:
ErrorPrompt(f'Failed to install systemd job:\n{err}').show()

Expand All @@ -391,6 +393,8 @@ def uninstall(self):
discovery_job.uninstall(Provider=TurtleBot4Extras)

self.daemon_reload()
except KeyError as err:
ErrorPrompt(f'Failed to uninstall existing systemd job:\n{err} is not defined').show()
except Exception as err:
ErrorPrompt(f'Failed to uninstall existing systemd job:\n{err}').show()

Expand Down

0 comments on commit 6519d9b

Please sign in to comment.