Error handling bugfix: pass #1

This commit is contained in:
2026-10-02 07:04:22 +01:00
parent 39a5e91eeb
commit d8ea4f8e02
53 changed files with 1179 additions and 410 deletions
+22 -4
View File
@@ -1,4 +1,22 @@
export default function writeErrorFile({ exitCode, error, }: {
error?: Bun.ErrorLike;
exitCode: number | null;
}): void;
type Params = {
/**
* Only include when the exiting process actually crashed with an error.
* Bun's spawn `onExit` `error` is only set on spawn failures, so callers
* that DO have the error (crash handlers) should pass `force: true`.
*/
force?: boolean;
error?: unknown;
exitCode?: number | null;
};
/**
* Writes the `BUNDLER_EXIT.txt` flag that the bundler pipeline watches to
* detect that the dev/prod child process previously crashed.
*
* Guardrails:
* - Never writes for clean exits (exitCode === 0) or signal deaths where no
* error is available (Ctrl+C must not leave a stale error file behind).
* - The supervisor writes only when the file does not already exist, so the
* crash handler's richer error/stack payload is not clobbered.
*/
export default function writeErrorFile({ force, error, exitCode, }: Params): void;
export {};