moveit2 icon indicating copy to clipboard operation
moveit2 copied to clipboard

Add try catch blogs around constructShapeFromMsg

Open sjahr opened this issue 1 year ago • 6 comments

Description

Fixes #1952

The shape constructors called in constructShapeFromMsg throw a runtime_error if it is provided with invalid dimensions (for example here. This PR catches these expectations for better error handling &renames two spartanly named variables.

Checklist

  • [ ] Required by CI: Code is auto formatted using clang-format
  • [ ] Extend the tutorials / documentation reference
  • [ ] Document API changes relevant to the user in the MIGRATION.md notes
  • [ ] Create tests, which fail without this PR reference
  • [ ] Include a screenshot if changing a GUI
  • [ ] While waiting for someone to review your request, please help review another open pull request to support the maintainers

sjahr avatar Jun 19 '23 22:06 sjahr

Codecov Report

Attention: Patch coverage is 64.53901% with 50 lines in your changes are missing coverage. Please review.

Project coverage is 50.78%. Comparing base (faa4795) to head (bf3c6e6). Report is 106 commits behind head on main.

Files Patch % Lines
...kinematic_constraints/src/kinematic_constraint.cpp 34.05% 31 Missing :warning:
moveit_core/robot_state/src/conversions.cpp 80.25% 16 Missing :warning:
moveit_core/planning_scene/src/planning_scene.cpp 76.93% 3 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2244      +/-   ##
==========================================
+ Coverage   50.35%   50.78%   +0.44%     
==========================================
  Files         390      391       +1     
  Lines       31954    32157     +203     
==========================================
+ Hits        16087    16328     +241     
+ Misses      15867    15829      -38     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Jun 20 '23 15:06 codecov[bot]

It's ok to add try catch blocks, but IMO it would be much better to replace the exceptions with assertions. The named cases are broken API contracts (=coding errors) and not really exceptions.

henningkayser avatar Jul 26 '23 15:07 henningkayser

This PR is stale because it has been open for 45 days with no activity. Please tag a maintainer for help on completing this PR, or close it if you think it has become obsolete.

github-actions[bot] avatar Oct 19 '23 12:10 github-actions[bot]

This pull request is in conflict. Could you fix it @sjahr?

mergify[bot] avatar Oct 27 '23 14:10 mergify[bot]

This PR is stale because it has been open for 45 days with no activity. Please tag a maintainer for help on completing this PR, or close it if you think it has become obsolete.

github-actions[bot] avatar Dec 12 '23 12:12 github-actions[bot]

This PR is stale because it has been open for 45 days with no activity. Please tag a maintainer for help on completing this PR, or close it if you think it has become obsolete.

github-actions[bot] avatar Feb 27 '24 12:02 github-actions[bot]