ros2 / examples

Example packages for ROS 2
Apache License 2.0
691 stars 311 forks source link

Remove bare exception catching to fix Flake8 failure #299

Closed sloretz closed 3 years ago

sloretz commented 3 years ago

While reviewing CI results I noticed these new flake8 failures on master:

https://ci.ros2.org/job/ci_linux/13378/#showFailuresLink

It complains about catching Exception, and wants specific exceptions to be caught instead. I reviewed the rclpy code handling the client futures, and discovered that there's actually no code setting exceptions on them currently, so the try/except blocks don't actually do anything. This PR removes them from the examples to resolve the flake8 failures.

@azeey FYI

sloretz commented 3 years ago

CI (build: --packages-up-to examples_rclpy_minimal_client test: --packages-select examples_rclpy_minimal_client)