New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead, replace all of this with rcutils_snprintf()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had one follow up comment but it is t blocking.
Signed-off-by: Chris Lalancette clalancette@openrobotics.org
Part of ros2/rcutils#196