DEV Community

Discussion on: Visual Studio Code can now convert your long chains of Promise.then()'s into async/await automagically

Collapse
 
shawnlan profile image
shawnlan

We have to be careful and understand how async/await works. The converted code doesn't behave exactly the same in the twitter example. Before conversion the function returns a promise that resolves with undefined, and console.log(err) is called. After conversion, the function returns a promise that rejects, and console.log(err) is not called. We would assume the converted code should behave the same; thus it's a bug IMO.