1 回答

TA貢獻(xiàn)1825條經(jīng)驗(yàn) 獲得超4個(gè)贊
該spawn方法返回對(duì)生成的孩子的引用。當(dāng)孩子退出時(shí),doneFunction調(diào)用 。您可以在出現(xiàn)錯(cuò)誤時(shí)從以下函數(shù)重試:
function doneFunction(error, result, code) {
// If the exit code was non-zero and a fallback wasn't specified, an Error
// object, otherwise null.
error
// The result object is an object with the properties .stdout, .stderr, and
// .code (exit code).
result
// When result is coerced to a string, the value is stdout if the exit code
// was zero, the fallback if the exit code was non-zero and a fallback was
// specified, or stderr if the exit code was non-zero and a fallback was
// not specified.
String(result)
// The numeric exit code.
code
}
添加回答
舉報(bào)