MCPcopy
hub / github.com/bombshell-dev/clack / handleExit

Function handleExit

packages/prompts/src/spinner.ts:60–72  ·  view source on GitHub ↗
(code: number)

Source from the content-addressed store, hash-verified

58 const styleFn = opts?.styleFrame ?? defaultStyleFn;
59
60 const handleExit = (code: number) => {
61 const msg =
62 code > 1
63 ? (errorMessage ?? settings.messages.error)
64 : (cancelMessage ?? settings.messages.cancel);
65 isCancelled = code === 1;
66 if (isSpinnerActive) {
67 _stop(msg, code);
68 if (isCancelled && typeof onCancel === 'function') {
69 onCancel();
70 }
71 }
72 };
73
74 const errorEventHandler = () => handleExit(2);
75 const signalEventHandler = () => handleExit(1);

Callers 2

errorEventHandlerFunction · 0.85
signalEventHandlerFunction · 0.85

Calls 2

_stopFunction · 0.85
onCancelFunction · 0.85

Tested by

no test coverage detected