-
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
Fix EPIPE error when hitting quit #225
Conversation
Steps to test:
|
Do we need to unpipe the pager when the main process exits? |
@joshbetz not sure what do you mean |
Sorry. If the issue is that we're trying to write to a closed stream, can we avoid writing to a closed stream by calling |
I'm still not that familiar with how streams work in the code base, but I've added |
I think the problem is here: https://github.com/Automattic/vip/blob/master/src/lib/cli/command.js#L326-L328 When this was originally added, I noted (#139):
Ideally that would be a function that returns a stream of a CLI table and when we call stream.read() (which is what happens internally when you pipe a read stream to a write stream), it queries the next page of results from the API and formats the table. Then, instead of manually calling |
I wonder if we are optimizing for ourselves instead of our users here. I think the average user don't have a list of more than few apps and we can afford getting them all in one request, don't you think so? |
This error is raised when trying to write to a closed stream. Node doesn't get rid of those extra messages and raises an error as per nodejs/node#947
From the same issue, it's supposed to be fixed in 8 and up. I tested in node 8 and 10 and I get the error.
This checks if the error code is
EPIPE
and return.fixes #175