This PR introduces some changes so that we can more gracefully handle failures in when using the nimblephysics algorithms in AddBiomechanics.
Added (well, modified) the new macos NIMBLE_THROW and NIMBLE_THROW_IF which throw a std::runtime_error (for the latter macro, upon a condition resolving to true). AddBiomechanics uses pybind11 which will automatically cast the std::runtime_error as a Python Exception, which we can then handle appropriately.
Replace all "Release"-level usages of exit(1) with these new macros, so that failures don't kill the entire AddBiomechanics processing pipeline.
This PR introduces some changes so that we can more gracefully handle failures in when using the
nimblephysics
algorithms inAddBiomechanics
.NIMBLE_THROW
andNIMBLE_THROW_IF
which throw astd::runtime_error
(for the latter macro, upon a condition resolving totrue
).AddBiomechanics
usespybind11
which will automatically cast thestd::runtime_error
as a PythonException
, which we can then handle appropriately.exit(1)
with these new macros, so that failures don't kill the entireAddBiomechanics
processing pipeline.