-
Notifications
You must be signed in to change notification settings - Fork 33
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,13 +46,19 @@ const start = (): Promise<CljConnectionInformation> => { | |
}); | ||
|
||
nreplProcess.stderr.on('data', data => { | ||
console.info('nrepl stderr =>', data.toString()); | ||
}); | ||
|
||
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(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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}'. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? |
||
}); | ||
}); | ||
}; | ||
|
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.
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.
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.
@mhansen Good idea. I'm gonna merge the PR as is but will create the related issue soon.
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.
Alright that's a good thing we should be thinking. We'll discuss it on #52.