Skip to content
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

Ignore nrepl process stderr #50

Merged
merged 1 commit into from
Jul 24, 2017
Merged

Conversation

fasfsfgs
Copy link
Contributor

nrepl process uses stderr to notify stuff other than error. When it's fired, it doesn't mean that nrepl didn't work.

This closes #47 and closes #48.

This closes avli#47 and closes avli#48.
Copy link
Contributor

@mhansen mhansen left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -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.

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?

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.

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.

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?

@avli avli merged commit 5de410f into avli:master Jul 24, 2017
@fasfsfgs fasfsfgs deleted the ignore-nrepl-stderr branch July 29, 2017 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error 'Can't start nREPL' Unable to start nREPL
3 participants