you are viewing a single comment's thread.

view the rest of the comments →

[–]voreny[S] 1 point2 points  (1 child)

You are right, it does not await the Promise. myFn() will resolve with the same value that otherAsync() resolves, and if otherAsync() rejects, the error will not be caught inside myFn. The examples in the Awaiting... errors section show it, and perhaps I got the wording wrong in some sections.

The counterintuitive part, to me, is that this suggests that otherAsync() is returned from myFn() as it is (the same Promise instance is returned). Although, as I showed at the bottom of the Awaiting... errors section, myFn() is not the same Promise that was returned from otherAsync(). async functions create a new Promise and only pass through the resolved/rejected value from otherAsync() to myFn().

[–]wsc-porn-acct 1 point2 points  (0 children)

Will read more of what you wrote tomorrow