Skip to content
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

indexer-cli: indexing rule parser error catch #421

Merged
merged 1 commit into from
Aug 9, 2022

Conversation

hopeyen
Copy link
Contributor

@hopeyen hopeyen commented May 13, 2022

When using wrong arguments for indexer rules set, the error message
TypeError: INDEXING_RULE_PARSERS[key] is not a function
is not very clear.

Improve the error message to specify the invalid key: when provided a non-existing attribute, return messages like
Indexing rule attribute 'allocatoinAmount' doesn't exist, please check spelling

for next step: can make suggestions using modules like spellchecker-cli

@hopeyen hopeyen linked an issue May 16, 2022 that may be closed by this pull request
@fordN
Copy link
Contributor

fordN commented May 17, 2022

Nice! Can we also output the help text after the message so the user can see what the supported parameters are?

@hopeyen hopeyen force-pushed the hope/cli-rules-parser-errors branch from a3643c9 to f16feaa Compare May 18, 2022 16:04
@hopeyen
Copy link
Contributor Author

hopeyen commented May 18, 2022

Nice! Can we also output the help text after the message so the user can see what the supported parameters are?

I ended up making a simple dumb suggestion function: if there's valid commands that shares 80% of the inputted letters, print those, otherwise print all available commands. Let me know if you think the help text would be better?

@hopeyen hopeyen force-pushed the hope/cli-rules-parser-errors branch from f16feaa to cde4fd4 Compare May 18, 2022 16:38
@hopeyen hopeyen force-pushed the hope/cli-rules-parser-errors branch 4 times, most recently from d48a094 to 6240193 Compare May 20, 2022 01:06
@fordN
Copy link
Contributor

fordN commented Jul 27, 2022

@hopeyen what's the status on this PR? Ready for another review?

@hopeyen hopeyen requested a review from fordN July 28, 2022 00:59
@hopeyen
Copy link
Contributor Author

hopeyen commented Jul 28, 2022

yep this one is ready for another review! thanks in advance

@hopeyen hopeyen force-pushed the hope/cli-rules-parser-errors branch 3 times, most recently from a82cd26 to cb16912 Compare July 29, 2022 23:04
@hopeyen hopeyen force-pushed the hope/cli-rules-parser-errors branch from cb16912 to 7104b65 Compare August 3, 2022 15:34
@hopeyen hopeyen force-pushed the hope/cli-rules-parser-errors branch from 7104b65 to d04b116 Compare August 3, 2022 16:35
@hopeyen hopeyen requested a review from fordN August 8, 2022 17:07
Copy link
Contributor

@fordN fordN left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@hopeyen hopeyen merged commit 68bdf7a into main Aug 9, 2022
@hopeyen hopeyen deleted the hope/cli-rules-parser-errors branch August 9, 2022 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🚗 Merged
Development

Successfully merging this pull request may close these issues.

Indexer-cli: Improve error message when using incorrect rule key
2 participants