Use the new rcutils_strerror function.#239
Conversation
6882736 to
812bf7f
Compare
812bf7f to
6c8d343
Compare
| throw std::runtime_error(errmsg); | ||
| #else | ||
| throw std::runtime_error(strerror(errno)); | ||
| #endif // _WIN32 |
There was a problem hiding this comment.
Instead, replace all of this with rcutils_snprintf()?
There was a problem hiding this comment.
For consistencies sake, I did switch to rcutils_snprintf. As far as I can tell, this doesn't remove the need for the rest of the error checking, so I left the rest as-is.
There was a problem hiding this comment.
Oh maybe I meant to say format string, it does the whole “how big? Allocate, snprintf, error handling” thing:
Though it would use an rcutils allocator instead.
Idiomatic c++ would use streams instead... or the format stuff if we had c++20.
Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
9477dd9 to
3619234
Compare
|
This is the last of the series that doesn't have an approval. Once this one is approved, I think I'm ready to merge this. @wjwwood any further thoughts about this one? |
|
It would be good to update the title of this PR (as well as siblings) to reflect the current state: using |
wjwwood
left a comment
There was a problem hiding this comment.
I had one follow up comment but it is t blocking.
Signed-off-by: Chris Lalancette clalancette@openrobotics.org
Part of ros2/rcutils#196