Skip to content

Commit

Permalink
Merge pull request rock-control#6 from thorounibremen/master
Browse files Browse the repository at this point in the history
Use specialized exceptions when reporting missing joint names
  • Loading branch information
dmronga authored Aug 31, 2020
2 parents 14f48fe + cef4993 commit 9f5b47d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tasks/Conversions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ void jointState2RmlTypes(const base::samples::Joints& joint_state, const std::ve
params.CurrentVelocityVector->VecData[i] = 0;
params.CurrentAccelerationVector->VecData[i] = 0;
}
catch(std::runtime_error e){
LOG_ERROR("Element %s has been configured in motion constraints, but is not available in joint state", names[i].c_str());
catch(const base::samples::Joints::InvalidName &e){
LOG_ERROR("Element %s has been configured in motion constraints, but is not available in joint state", e.name.c_str());
throw e;
}
}
Expand Down Expand Up @@ -207,8 +207,8 @@ void target2RmlTypes(const ConstrainedJointsCmd& target, const MotionConstraints
motionConstraint2RmlTypes(constraint, idx, params);
}
}
catch(std::runtime_error e){
LOG_ERROR("Joint '%s' is in target vector but has not been configured in motion constraints", target.names[i].c_str());
catch(const MotionConstraints::InvalidName &e){
LOG_ERROR("Joint '%s' is in target vector but has not been configured in motion constraints", e.name.c_str());
throw e;
}
}
Expand All @@ -227,8 +227,8 @@ void target2RmlTypes(const ConstrainedJointsCmd& target, const MotionConstraints
motionConstraint2RmlTypes(constraint, idx, params);
}
}
catch(std::runtime_error e){
LOG_ERROR("Joint '%s' is in target vector but has not been configured in motion constraints", target.names[i].c_str());
catch(const MotionConstraints::InvalidName &e){
LOG_ERROR("Joint '%s' is in target vector but has not been configured in motion constraints", e.name.c_str());
throw e;
}
}
Expand Down

0 comments on commit 9f5b47d

Please sign in to comment.