I am writing an extension with useful utility blocks. Two of them are try and try-catch blocks, but it seems like they don’t work when a block that causes errors is put in.
Here’s the code for the try-catch block, another issue I have is that I can’t have multiple “mouths” (where you can put code in):
export function tryCatchCode(tryCode: () => void, catchCode: (errorName: string) => void): void {
try {
tryCode();
} catch (error) {
catchCode(error.name);
}
}
Is it possible to have two “mouths” in a single block and are try statements supported?