mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
fix(node): errno property when command missing (#22691)
Fixes https://github.com/denoland/deno/issues/22604 `remix dev` with Node adapter works: ``` $ ~/gh/littledivy/deno/target/debug/deno task dev Task dev remix dev --manual 💿 remix dev info building... info built (619ms) [remix-serve] http://localhost:3000 (http://192.168.1.24:3000) GET / 200 - - 3.090 ms ```
This commit is contained in:
parent
6650019935
commit
5a28d70e05
2 changed files with 17 additions and 1 deletions
|
@ -275,7 +275,11 @@ export class ChildProcess extends EventEmitter {
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.#_handleError(err);
|
let e = err;
|
||||||
|
if (e instanceof Deno.errors.NotFound) {
|
||||||
|
e = _createSpawnSyncError("ENOENT", command, args);
|
||||||
|
}
|
||||||
|
this.#_handleError(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -771,3 +771,15 @@ Deno.test(async function execFileWithUndefinedTimeout() {
|
||||||
);
|
);
|
||||||
await promise;
|
await promise;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Deno.test(async function spawnCommandNotFoundErrno() {
|
||||||
|
const { promise, resolve } = Promise.withResolvers<void>();
|
||||||
|
const cp = CP.spawn("no-such-command");
|
||||||
|
cp.on("error", (err) => {
|
||||||
|
const errno = Deno.build.os === "windows" ? -4058 : -2;
|
||||||
|
// @ts-ignore: errno missing from typings
|
||||||
|
assertEquals(err.errno, errno);
|
||||||
|
resolve();
|
||||||
|
});
|
||||||
|
await promise;
|
||||||
|
});
|
||||||
|
|
Loading…
Reference in a new issue