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
[Data transfer] aborting prompts displays as error #15974
Conversation
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## main #15974 +/- ##
==========================================
+ Coverage 51.61% 60.68% +9.07%
==========================================
Files 374 1495 +1121
Lines 14091 36876 +22785
Branches 3168 7355 +4187
==========================================
+ Hits 7273 22380 +15107
- Misses 5617 12415 +6798
- Partials 1201 2081 +880
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
@@ -116,7 +117,7 @@ const confirmMessage = (message) => { | |||
}, | |||
]); | |||
if (!answers.confirm) { | |||
exitWith(0); | |||
exitWith(1, failMessage); |
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.
Should we add a default value for the fail message?
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.
This is intended as a generic way to confirm a prompt, I'm not sure we could come up with text that wouldn't be more annoying to have to override every time.
I'm already not completely convinced on this being an error exit code, because if the user is specifically saying "no" it's not an error, it's working as intended. (and I at least want to keep the link between "red message" and "error" and not deviate from that)
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.
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.
Not sure which one we should use though.
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.
If I'm interpreting this right:
First example you cancelled during a prompt and got a 0.
Second example you cancelled while it was working and got a 1.
Third example was cancelled during a password prompt for sudo and got a 1.
I think my preference is for a 0/warning, but I'm not opposed to a 1/error, so I think we should just go with it since it makes it easier for anything reading the exit code to interpret it as "ok, there was an error so the transfer didn't succeed" and also lets the user know the same with red text.
What does it do?
When a user doesn't enter data for a prompt, the error message works as described below.
Why is it needed?
As a shipper
How to test it?
see above