-
Notifications
You must be signed in to change notification settings - Fork 16
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
Throw custom errors from spawn #32
Conversation
I like this. It solves two problems, the first is "how do we tell the user what actually went wrong in a clear way" and the other is "how do we allow pactote to programmatically know how to react to certain errors. |
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.
I think this is shippable
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 looks great
Implements some custom error subclasses that get thrown by spawn when known or unknown git errors occur.
Then in packages like
pacote
we can do something like:Details
The git reference could not be found.
) followed by the full error form@npmcli/promise-spawn
available viaer.stderr
(which gets printed by the cli error handler)@npmcli/promise-spawn
are assigned to the custom errorTODO