Skip to content
Myr

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 file

Take it

Split files (#837)ehmickybefore adoption672c2d7

lines 1–5why, one step back
1import {DiscardedError} from '../return/error.js';
23export const waitForSuccessfulExit = async exitPromise => {4 const [exitCode, signal] = await exitPromise;5

Rename `spawned` and `child process` to `subprocess` (#897)ehmickybefore adoption8fe2343

line 6why, one step back
6 if (!isSubprocessErrorExit(exitCode, signal) && isFailedExit(exitCode, signal)) {

Split files (#837)ehmickybefore adoption672c2d7

lines 7–12why, one step back
7 throw new DiscardedError();
8 }910 return [exitCode, signal];11};12

Rename `spawned` and `child process` to `subprocess` (#897)ehmickybefore adoption8fe2343

line 13why, one step back
13const isSubprocessErrorExit = (exitCode, signal) => exitCode === undefined && signal === undefined;

Split files (#837)ehmickybefore adoption672c2d7

line 14why, one step back
14export const isFailedExit = (exitCode, signal) => exitCode !== 0 || signal !== null;