Closed samreid closed 3 years ago
I was just bit by this for skiffle, so I committed https://github.com/phetsims/perennial/commit/6764b284fabc82bdaf0b9e9e722bf6873728214f, which fixes this issue, but only handles part of the work to be done over in your recommendation in https://github.com/phetsims/perennial/issues/206#issuecomment-793031078.
This is the error before I cloned skiffle after that commit:
Michael ~/PHET/git
$ pa
(node:35596) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:35596) UnhandledPromiseRejectionWarning: Error: git pull --rebase in skiffle failed with exit code -1 and stdout:
at ChildProcess.<anonymous> (C:\Users\Michael\PHET\git\perennial\js\common\execute.js:76:15)
at ChildProcess.emit (events.js:315:20)
at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
at onErrorNT (internal/child_process.js:465:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
(node:35596) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function witho
ut a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the
CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:35596) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will te
rminate the Node.js process with a non-zero exit code.
It could be further improved if we surround the execute commands in pull-all.js in a try catch and handle the rejections.
I added optional resolve support for process errors, and support it in the pull-all.js harness. You can test it by adding a fake repo name to active-repos.js and running pull-all.js. I see this:
~/apache-document-root/main$ pull
## fakeREPO
Error: spawn git ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
at onErrorNT (internal/child_process.js:465:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn git',
path: 'git',
spawnargs: [ 'pull', '--rebase' ]
}
@zepumph can you please review?
Excellent!
This is a specific subproblem from #206.
Error when running pull-all.js with a missing repo: