Created
November 30, 2024 16:40
-
-
Save johnlindquist/2be9e526308bdc5f50ad23e5780221fc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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