Draft
Conversation
Users should be able to query whether a subscription is valid without having an error set. Only set an error if an invalid pointer (e.g. NULL) was passed in. Signed-off-by: Chris Lalancette <clalancette@gmail.com>
A user should be able to query whether a client is valid without an error being set. Fix that here. Signed-off-by: Chris Lalancette <clalancette@gmail.com>
A user should be able to query whether an event is valid without an error being set. Fix that here. Signed-off-by: Chris Lalancette <clalancette@gmail.com>
A user should be able to query whether a node is valid without setting an error. Fix that here. Signed-off-by: Chris Lalancette <clalancette@gmail.com>
A user should be able to query whether a publisher is valid without it setting an error. Fix that here. Signed-off-by: Chris Lalancette <clalancette@gmail.com>
A user should be able to query whether a service is valid without it setting an error. Fix that here. Signed-off-by: Chris Lalancette <clalancette@gmail.com>
A user should be able to query whether a service event publisher is valid without it setting an error. Fix that here. Signed-off-by: Chris Lalancette <clalancette@gmail.com>
A user should be able to query whether a wait_set is valid without it setting an error, which it already does. However, passing a NULL into it is logically invalid; we can't possibly answer that question. So set an error in that case. Signed-off-by: Chris Lalancette <clalancette@gmail.com>
Contributor
Author
Signed-off-by: Chris Lalancette <clalancette@gmail.com>
fujitatomoya
approved these changes
Aug 7, 2023
Collaborator
fujitatomoya
left a comment
There was a problem hiding this comment.
lgtm
just asking the question of whether it is valid should never return an error.
makes sense to me.
Contributor
Author
|
The more I look at this, the less I like it. If you are looking at these I'm going to turn this into a draft for now until I come up with something better. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently if you call one of the rcl "is_valid" functions on an uninitialized pointer of the correct type, it will return false but it will also set an error. But this doesn't seem correct; just asking the question of whether it is valid should never return an error. This PR fixes that.
Note that if you pass a NULL pointer into the "is_valid" function, you'll still get an error set. That seems reasonable since you are basically asking a nonsense question.