MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / classifySidecarExit

Function classifySidecarExit

apps/desktop/src/main/sidecar-exit.ts:40–50  ·  view source on GitHub ↗
(input: SidecarExitInput)

Source from the content-addressed store, hash-verified

38 | { readonly kind: "crash" };
39
40export const classifySidecarExit = (input: SidecarExitInput): SidecarExitClassification => {
41 if (input.stoppedByUs) return { kind: "managed-stop", reason: "stopped-by-app" };
42 if (input.appQuitting) return { kind: "managed-stop", reason: "app-quitting" };
43 if (input.signal !== null && SHUTDOWN_SIGNALS.has(input.signal)) {
44 return { kind: "external-shutdown", reason: input.signal };
45 }
46 if (input.code !== null && SHUTDOWN_EXIT_CODES.has(input.code)) {
47 return { kind: "external-shutdown", reason: `code ${input.code}` };
48 }
49 return { kind: "crash" };
50};

Callers 2

onExitFunction · 0.90
classifyFunction · 0.90

Calls

no outgoing calls

Tested by 1

classifyFunction · 0.72