@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
ts 13 lines 562 Bytes
Raw
1 import * as NodeOS from "node:os";
2
3 // libuv has no name for EDQUOT, so Node reports it as code "UNKNOWN" with the raw errno.
4 const EDQUOT_ERRNO = NodeOS.constants.errno.EDQUOT;
5
6 // Redirected console output can fail when its log volume is full.
7 export function handleStdioError(error: unknown): void {
8 if (typeof error === "object" && error !== null) {
9 if ("code" in error && (error.code === "EPIPE" || error.code === "ENOSPC")) return;
10 if (EDQUOT_ERRNO !== undefined && "errno" in error && error.errno === -EDQUOT_ERRNO) return;
11 }
12 throw error;
13 }