-
Notifications
You must be signed in to change notification settings - Fork 223
Fix confusing error message when query is empty #6787
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
base: main
Are you sure you want to change the base?
Conversation
Coverage report
Show new covered files 🐣
Show files with reduced coverage 🔻
Test suite run success3688 tests passing in 1431 suites. Report generated by 🧪jest coverage report action from 52e54ff |
|
We detected some changes at Caution DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release. |
f6cb114 to
52e54ff
Compare
jordanverasamy
left a comment
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.
nicee

Resolves: https://github.com/orgs/shop/projects/208/views/34?pane=issue&itemId=3840291657&issue=shop%7Cissues-api-foundations%7C1312
Problem
The code would reach this
BugError, which it should never reach. This was because when a query or query file was blank, it was considered "provided" by oclif (satisfying the exactlyOne constraint) but empty by the code.Solution
Added validation that checks if the query or query file content is blank, and throws a user-friendly error message instead of falling through to the
BugError.Test plan
--queryflag--queryflag with only whitespaceBefore and After
Before:
--queryor empty--query-file:After:
For empty

--query:For empty

--query-file: