Files
bot-agents/src/errors.ts
T
Danny Kim 8f23da2b42
Agents / agent (pull_request) Has been skipped
Check / check (pull_request) Successful in 58s
Move the action from Deno to Node.js and Vite+
2026-10-16 02:20:49 +09:00

9 lines
321 B
TypeScript

// Node reports a missing file as ENOENT and a missing process as ESRCH, where
// Deno threw `Deno.errors.NotFound` for both.
export function isNotFound(error: unknown): boolean {
if (!(error instanceof Error) || !("code" in error)) {
return false;
}
return error.code === "ENOENT" || error.code === "ESRCH";
}