// file: regular_async_test.ts
const one = async () => {
throw new Error("uhoh");
};
const two = async () => await one();
const three = async () => await two();
Deno.test("regular async traceback", () => three());
Deno.test("regular async traceback with await", async () => await three());
// false if running under `deno test`
if (import.meta.main) {
try {
await three();
} catch (e) {
console.debug({
errInst: e instanceof Error,
cause: e.cause,
stack: e.stack,
});
console.error("logging and rethrowing error:", e);
throw e;
}
}
// file: regular_async_test.ts
const one = async () => {
throw new Error("uhoh");
};
const two = async () => await one();
const three = async () => await two();
Deno.test("regular async traceback", () => three());
Deno.test("regular async traceback with await", async () => await three());
// false if running under `deno test`
if (import.meta.main) {
try {
await three();
} catch (e) {
console.debug({
errInst: e instanceof Error,
cause: e.cause,
stack: e.stack,
});
console.error("logging and rethrowing error:", e);
throw e;
}
}