Uh oh!
There was an error while loading. Please reload this page.
debugger: improve ESRCH error message - #1863
Conversation
Fishrock123
commented
Jun 1, 2015
SGTM.. |
JacksonTian
commented
Jun 2, 2015
Thank you. @Fishrock123@bnoordhuis@thefourtheye |
JacksonTian
commented
Jun 2, 2015
The smart os has a timeout error. It seems not related. And the raspbian is so slowly.
|
bnoordhuis
commented
Jun 3, 2015
LGTM but can I have one more LGTM from @nodejs/collaborators? Perhaps it would be good to have a regression test for this. |
There was a problem hiding this comment.
Shouldn't this be stderr then?
Fishrock123
commented
Jun 3, 2015
A question, but LGTM, tests are always nice. :) |
indutny
commented
Jun 3, 2015
LGTM, with one nit from @Fishrock123 |
JacksonTian
commented
Jun 5, 2015
Add the regression test. |
There was a problem hiding this comment.
We don't need to use escape \ enclosed by " or `.
console.error(`Target process: ${pid} doesn't exist.`);There was a problem hiding this comment.
Didn’t see template string be used in node core, so I don’t use it. If it’s recommend, I will replace it.
在 2015年6月5日,上午11:21,Yosuke Furukawa notifications@github.com 写道:
In lib/_debugger.js #1863 (comment):
@@ -1639,7 +1639,16 @@ Interface.prototype.trySpawn = function(cb) {
} else if (this.args.length === 3) {
//node debug -p pid
if (this.args[1] === '-p' && /^\d+$/.test(this.args[2])) {
process._debugProcess(parseInt(this.args[2], 10));const pid = parseInt(this.args[2], 10);try {process._debugProcess(pid);} catch (e) {if (e.code === 'ESRCH') { We don't need to use escape \ enclosed by " or `.console.error('Target process: ' + pid + ' doesn\'t exist.');console.error(
Target process: ${pid} doesn't exist.);
—
Reply to this email directly or view it on GitHub https://github.com/nodejs/io.js/pull/1863/files#r31785321.
There was a problem hiding this comment.
Yes, We can use template string literals. We switched closure-linter to eslint.
https://github.com/nodejs/io.js/blob/master/.eslintrc#L7
When use `iojs debug -p <pid>` with an invalid pid, the debugger print internal error message also, it not enough smart.
JacksonTian
commented
Jun 5, 2015
@yosuke-furukawa used the template string. |
bnoordhuis
commented
Jun 5, 2015
yosuke-furukawa
commented
Jun 5, 2015
Yes. LGTM. |
bnoordhuis
commented
Jun 5, 2015
Here's another test run: https://jenkins-iojs.nodesource.com/view/iojs/job/iojs+any-pr+multi/772/ - the last one failed because of style issues in the test case... |
When using `iojs debug -p <pid>` with an invalid pid, the debugger printed an internal error message because it wasn't smart enough to figure out that the target process didn't exist. Now it is. PR-URL: #1863 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Fedor Indutny <fedor@indutny.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Yosuke Furukawa <yosuke.furukawa@gmail.com>
bnoordhuis
commented
Jun 5, 2015
Thanks @JacksonTian, landed in 81029c6. |
When use
iojs debug -p <pid>with an invalid pid,the debugger print internal error message also,
it not enough smart.