Skip to content

Ignore nrepl process stderr #50

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

Merged
merged 1 commit into from
Jul 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions src/nreplController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,19 @@ const start = (): Promise<CljConnectionInformation> => {
});

nreplProcess.stderr.on('data', data => {
console.info('nrepl stderr =>', data.toString());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Not blocking for now, but just a thought: we could wire this up to a vscode.OutputChannel, so users can see any output without having to run the extension under debugging mode (I think console.info only shows up when debugging the extension?)

But probably not worth doing in this review, probably needs a bit more thought.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mhansen Good idea. I'm gonna merge the PR as is but will create the related issue soon.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright that's a good thing we should be thinking. We'll discuss it on #52.

});

nreplProcess.on('exit', (code, signal) => {
console.info(`nREPL exit => ${code} / Signal: ${signal}`);
stop();
return reject(`This error happened with our nREPL process: ${data}`);
return reject();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just checking: Do we want to reject() even if the exit code is 0? I suppose we do, if it exits before we manage to resolve() the Promise by getting the connection info, we should probably treat that as an error. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could reject the promise with an error string, then it'd show up in the vscode.window.showErrorMessage. This would make it easier both for users to understand what's going on, and for us to understand what's going wrong with bug reports in the future. Perhaps we could say here something like 'nREPL unexpectedly exited, error code ${code}'.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mhansen Again, good idea. I'll add the related issue.

});

nreplProcess.on('close', (code, signal) => {
console.info(`nREPL close => ${code} / Signal: ${signal}`);
stop();
return reject(`Our nREPL was closed. Code: ${code} / Signal: ${signal}`);
return reject();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above, consider adding an error message, to help us (& the user) debug what's going on?

});
});
};
Expand Down