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
Error helper #4
Comments
Yes please! 👍 |
Yeah, sure, that'd be useful I think. I'm using the same pattern everywhere in my CLIs too. |
How about the verbose thing? |
How do we change the |
Maybe Could also be a second argument to fn('unicorn', cli.handleError(err)); |
Hmm, why wouldn't that work? |
Oops, should have been: fn('unicorn', cli.handleError); Might not be a problem though. Since you can just wrap it in a function, and arrow functions will make that nicer. |
Yeah, exactly, shouldn't be that big of a deal. Better future compatibility too if we wanted to add even more stuff. |
var err = new Error('Output file exists')
err.exitCode = 9
err.code = 'EEXISTS'
cli.handleError(err) |
Skipping this as we now handle promise errors automagically and I'm not going to continue using callback-style interface. |
Most of my CLI's have this:
Wonder if we could abstract out the error handling.
Eg:
It could potentially also handle showing the stack when
--verbose
is passed.Thoughts?
// @kevva @floatdrop @arthurvr @shinnn
The text was updated successfully, but these errors were encountered: