1 回答

TA贡献1825条经验 获得超4个赞
该spawn方法返回对生成的孩子的引用。当孩子退出时,doneFunction调用 。您可以在出现错误时从以下函数重试:
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
}
添加回答
举报