Skip to content

Instantly share code, notes, and snippets.

@johnlindquist
Created November 30, 2024 16:40
Show Gist options
  • Save johnlindquist/2be9e526308bdc5f50ad23e5780221fc to your computer and use it in GitHub Desktop.
Save johnlindquist/2be9e526308bdc5f50ad23e5780221fc to your computer and use it in GitHub Desktop.
// Name: Testing Restart Prompt
import "@johnlindquist/kit";
let errorCount = 0;
let noError = false;
while (!noError) {
try {
throw new Error();
} catch (e) {
type options = "retry" | "ignore";
const choice: options = await arg(`Errored, restarting... ${errorCount}`, [
"retry",
"ignore",
] as options[]);
if (choice === "retry") {
errorCount++;
continue;
}
noError = true;
}
}
await div("done");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment