Files
ValueScript/inputs/passing/exceptions/nestedTry.ts
Andrew Morris ba68ef697a Test exceptions
2023-03-23 15:48:33 +11:00

22 lines
347 B
TypeScript

// test_output! ["here","nested boom","boom"]
export default function () {
let logs: unknown[] = [];
try {
logs.push("here");
try {
throw new Error("nested boom");
} catch (error) {
logs.push(error.message);
}
throw new Error("boom");
} catch (error) {
logs.push(error.message);
}
return logs;
}