Skip to content

Commit

Permalink
Use more relevant error type
Browse files Browse the repository at this point in the history
Use POSE_RELATIVE_TO_GRAPH_ERROR instead of
ELEMENT_INVALID when a valid PoseRelativeToGraph pointer
is not available.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
  • Loading branch information
scpeters committed Jul 24, 2020
1 parent eb60eca commit 61af87b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Model.cc
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ Errors Model::SetPoseRelativeToGraph(
auto graph = _graph.lock();
if (!graph)
{
errors.push_back({ErrorCode::ELEMENT_INVALID,
errors.push_back({ErrorCode::POSE_RELATIVE_TO_GRAPH_ERROR,
"Tried to set PoseRelativeToGraph with invalid pointer."});
return errors;
}
Expand Down
2 changes: 1 addition & 1 deletion src/SemanticPose.cc
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Errors SemanticPose::Resolve(
auto graph = this->dataPtr->poseRelativeToGraph.lock();
if (!graph)
{
errors.push_back({ErrorCode::ELEMENT_INVALID,
errors.push_back({ErrorCode::POSE_RELATIVE_TO_GRAPH_ERROR,
"SemanticPose has invalid pointer to PoseRelativeToGraph."});
return errors;
}
Expand Down

0 comments on commit 61af87b

Please sign in to comment.