Skip to content

fix: valid index in cli#1055

Merged
isaacbrodsky merged 1 commit intouber:masterfrom
justinhwang:justinhwang/fix
Oct 10, 2025
Merged

fix: valid index in cli#1055
isaacbrodsky merged 1 commit intouber:masterfrom
justinhwang:justinhwang/fix

Conversation

@justinhwang
Copy link
Copy Markdown
Contributor

Similar to #1042

@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 98.934%. remained the same
when pulling 2a3abd2 on justinhwang:justinhwang/fix
into e9437f2 on uber:master.

Comment thread src/apps/filters/h3.c
H3_EXPORT(isValidDirectedEdge)(cell) ||
H3_EXPORT(isValidVertex)(cell);
if (!isValid) {
return E_DOMAIN; // TODO: maybe create a new E_INDEX_INVALID error?
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the set of errors I would probably just go with E_FAILED. You can see in the new tests that the error message given when these sub-commands are called incorrectly is confusing with the current text it returns.

Looking at the text it can select from that would still be sub-optimal and E_CELL_INVALID's error message would be more legible, but it also wouldn't be correct in some situations, so I'm not so sure about it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we follow up with a method that wraps this logic for us (3x valid checks) and add a generic index invalid error?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like some feedback from @isaacbrodsky @nrabinowitz and @ajfriend but I do think a general isValid function and a new error code would be better.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would make sense to add an E_INVALID_INDEX (#1044) and associated helper function. I am also fine with this PR as I understand it corrects the check that the index is valid.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be in favor of #1043 and #1044. Up to you, @justinhwang if you want to do that now, or if we should follow up on it.

Although, we'd should probably make those changes before the next release to minimize the number of times we modify the error codes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah feel free to merge this one, I can follow up with #1043 and #1044

@isaacbrodsky isaacbrodsky merged commit 08a2ee9 into uber:master Oct 10, 2025
45 checks passed
@justinhwang justinhwang deleted the justinhwang/fix branch October 10, 2025 15:32
@ajfriend ajfriend added this to the v4.4 milestone Oct 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants