summaryrefslogtreecommitdiff
path: root/cli/tests/testdata/test/trace_ops_caught_error/main.ts
blob: 8194a8b2a1c41890b133a12ec60639d52cbf20b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
Deno.test("handle thrown error in async function", async () => {
  const dirPath = Deno.makeTempDirSync();
  const filePath = `${dirPath}/file.txt`;
  try {
    await Deno.stat(filePath);
  } catch {
    await Deno.writeTextFile(filePath, "");
  } finally {
    await Deno.remove(filePath);
    await Deno.remove(dirPath);
  }
});