在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問(wèn)答/網(wǎng)絡(luò)安全/ async/await 有什么好的調(diào)試技巧嗎

async/await 有什么好的調(diào)試技巧嗎

比如報(bào)錯(cuò):

(node:50751) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): TypeError: Cannot read property '_id' of undefined
(node:50751) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

完全不知道哪里出了問(wèn)題。

回答
編輯回答
澐染

只在有必要的地方使用try...catch...

如果使用TypeScript的話, 有一個(gè)優(yōu)化調(diào)試體驗(yàn)的小技巧: https://code.visualstudio.com...

2018年5月3日 07:48
編輯回答
苦妄

強(qiáng)烈推薦用這個(gè)
https://github.com/scopsy/awa...

try可以寫(xiě)在最外層

2017年2月21日 21:07
編輯回答
小曖昧

我最后發(fā)現(xiàn),要大量使用 try catch,。暫時(shí)無(wú)更好的方法

2018年4月9日 11:26