Chapter 12: move and rename async stack trace example
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
foo().then(
|
||||
() => console.log("success"),
|
||||
(error) => console.error(error.stack)
|
||||
);
|
||||
|
||||
async function foo() {
|
||||
await bar();
|
||||
}
|
||||
|
||||
async function bar() {
|
||||
await Promise.resolve();
|
||||
throw new Error("Fail");
|
||||
}
|
||||
Reference in New Issue
Block a user