Error handling bugfix: pass #1
This commit is contained in:
Vendored
+22
-4
@@ -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 {};
|
||||
|
||||
Reference in New Issue
Block a user