Created
November 30, 2024 16:37
-
-
Save johnlindquist/fcef428a0197b4e48e2e0b530b1e03e2 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 { Action } from "@johnlindquist/kit"; | |
let errorCount = 0; | |
let error = true; | |
while (error) { | |
error = false; | |
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") { | |
error = true; | |
errorCount++; | |
continue; | |
} | |
} | |
} | |
await div("done"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment