Skip to content

Commit 6a62cb8

Browse files
committed
Catch expected exceptions only
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
1 parent bbd8893 commit 6a62cb8

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

ros2action/ros2action/verb/info.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
import rclpy
1516
from ros2action.api import action_name_completer
1617
from ros2action.api import get_action_clients_and_servers
1718
from ros2action.verb import VerbExtension
@@ -40,7 +41,7 @@ def main(self, *, args):
4041
node=node,
4142
action_name=args.action_name,
4243
)
43-
except Exception as e:
44+
except (ValueError, rclpy.exceptions.InvalidTopicNameException) as e:
4445
raise RuntimeError(e)
4546

4647
print('Action: {}'.format(args.action_name))

0 commit comments

Comments
 (0)