Skip to content

Commit

Permalink
Capture nested errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mjcarroll committed Sep 21, 2021
1 parent 0c90176 commit 4484116
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ForceTorque.cc
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ Errors ForceTorque::Load(ElementPtr _sdf)
}
}

auto loadAxisNoise = [](sdf::ElementPtr _parent,
auto loadAxisNoise = [&errors](sdf::ElementPtr _parent,
const std::string _groupLabel,
const std::string _axisLabel,
sdf::Noise& _noise)
Expand All @@ -139,7 +139,8 @@ Errors ForceTorque::Load(ElementPtr _sdf)
_parent->GetElement(_groupLabel)->HasElement(_axisLabel))
{
auto axis = _parent->GetElement(_groupLabel)->GetElement(_axisLabel);
_noise.Load(axis->GetElement("noise"));
sdf::Errors noiseErrors = _noise.Load(axis->GetElement("noise"));
errors.insert(errors.end(), noiseErrors.begin(), noiseErrors.end());
return true;
}
return false;
Expand Down

0 comments on commit 4484116

Please sign in to comment.