-
Notifications
You must be signed in to change notification settings - Fork 579
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
Faucet improvements (fix bug #961) #1048
Conversation
ironfish-cli/src/commands/faucet.ts
Outdated
@@ -41,7 +41,7 @@ export class FaucetCommand extends IronfishCommand { | |||
|
|||
if (!email) { | |||
email = (await CliUx.ux.prompt('Enter your email to stay updated with Iron Fish', { | |||
required: false, | |||
required: true, |
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.
Email isn't required, as it uses your public key if you don't specify an email.
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.
Oh oops, you're right. I thought it was required cause leaving email blank results in Collecting your funds... You entered an invalid email.
. Turns out it submits an empty string to the API, which always fails. So we need to pass undefined
if a user skips email.
Updated the PR for this.
This PR creates a bug in that an errored command now returns an exit code 0. I do agree the error that yarn outputs is really annoying. We manage and print our own errors, so we don't need yarns. It's actually expected that non zero exit codes are returned in CLI commands, or else you can't use the CLI for programatic purposes, and you could have to artificially return 0 in all commands which we don't do. There is unfortunately no way in yarn to suppress this for individual commands. We could use --silent in a |
Yea, that's a bit annoying. I think adding --silent in |
ironfish-cli/.yarnrc
Outdated
@@ -0,0 +1 @@ | |||
--silent true |
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 the tricky thing I was trying to point out. If you do this, it breaks all the logs for developers using yarn commands for install, build, etc because nothing is printed. Honestly, I think if you're using from source you have to be prepared to use engineering tooling and know how it works and be okay with these errors.
We're going to release NPM builds soon so 90% of users won't be running from source anymore and therefore should not be running yarn.
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.
gotcha. yea, I'm not too concerned with the current error messaging. will just leave bug #961 as is then.
This looks good, merging! |
Improve Faucet
Too many faucet requests
andYou entered an invalid email.
errors result inerror Command failed with exit code 1.
, as seen in Bug #961. Improve error handling to exit gracefully here.Is this a breaking change? If yes, add notes below on why this is breaking and
what additional work is required, if any.