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

Catch all yargs validation errors in isYargsError #504

Merged
merged 5 commits into from
Dec 11, 2024
Merged

Conversation

ecooper
Copy link
Contributor

@ecooper ecooper commented Dec 11, 2024

Problem

Some yargs validation errors are returning as "unknown errors". Unknown errors display bug report instructions, which we don't want.

Solution

Using the validation code, a list of error prefixes have been compiled. We check those. While it's not perfect, it's probably better than parsing the stack trace.

Result

Instead of returning

<snip help>

An unexpected error occurred...

Not enough non-option arguments: got 0, need at least 1

If you believe this is a bug, please report this issue on GitHub: https://github.com/fauna/fauna-shell/issues

We return

<snip help>

Not enough non-option arguments: got 0, need at least 1

@ecooper ecooper requested a review from a team as a code owner December 11, 2024 00:36
@ecooper ecooper merged commit e25ef6d into v3 Dec 11, 2024
4 checks passed
@ecooper ecooper deleted the v3-catch-yargs branch December 11, 2024 18:09
@cleve-fauna cleve-fauna mentioned this pull request Dec 13, 2024
@mwilde345 mwilde345 mentioned this pull request Dec 18, 2024
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.

3 participants