code.js
This file
Path
lib/exit/code.js
14 lines · 494 bytes · JavaScript
Last changed by
Rename `spawned` and `child process` to `subprocess` (#897)ehmickybefore adoption8fe2343
History of this fileTake it
Split files (#837)ehmickybefore adoption672c2d7
lines 1–5why, one step back1import {DiscardedError} from '../return/error.js';23export const waitForSuccessfulExit = async exitPromise => {4 const [exitCode, signal] = await exitPromise;5Rename `spawned` and `child process` to `subprocess` (#897)ehmickybefore adoption8fe2343
line 6why, one step back6 if (!isSubprocessErrorExit(exitCode, signal) && isFailedExit(exitCode, signal)) {Split files (#837)ehmickybefore adoption672c2d7
lines 7–12why, one step back7 throw new DiscardedError();8 }910 return [exitCode, signal];11};12Rename `spawned` and `child process` to `subprocess` (#897)ehmickybefore adoption8fe2343
line 13why, one step back13const isSubprocessErrorExit = (exitCode, signal) => exitCode === undefined && signal === undefined;Split files (#837)ehmickybefore adoption672c2d7
line 14why, one step back14export const isFailedExit = (exitCode, signal) => exitCode !== 0 || signal !== null;