当前位置:网站首页>try catch 不能捕获异步错误
try catch 不能捕获异步错误
2022-04-23 06:02:00 【NOyesNONO_】
try{
setTimeout(()=>{
throw new Error('报错信息')
},10)
}catch(e){
console.loe(e)
}
需要在 throw new Error 外直接加 try catch
try{
setTimeout(()=>{
try{
throw new Error('报错信息')
}catch(e){
console.log(e,'1')
}
},10)
}catch(e){
参考来源:
https://www.cnblogs.com/zhansu/p/11050641.html
版权声明
本文为[NOyesNONO_]所创,转载请带上原文链接,感谢
https://blog.csdn.net/NOyesNONO_/article/details/121263282
边栏推荐
- Kids and COVID: why young immune systems are still on top
- PHP unlimited classification and tree
- 端口占用1
- LeetCode刷题|两个链表的第一个公共节点
- Detailed explanation of RDMA programming
- openvswitch 编译安装
- Introduction to DDoS attack / defense
- Virtio and Vhost_ Net introduction
- 重启Oracle监听器会中断已有连接吗
- Imitation scallop essay reading page
猜你喜欢
随机推荐
将博客搬至CSDN
LeetCode刷题|897递增顺序搜索树
Introduction to DDoS attack / defense
Kids and COVID: why young immune systems are still on top
How to use DBA_ hist_ active_ sess_ History analysis database history performance problems
volatile 关键字的三大特点【数据可见性、指令禁止重排性、不保证操作原子性】
Solution to page cache problem (use with caution)
Ansible basic commands, roles, built-in variables and tests judgment
file_ get_ Two solutions to content accessing SSL errors
异常记录-7
端口占用1
Basic concepts of database: OLTP / OLAP / HTAP, RPO / RTO, MPP
openvswitch vlan网络实践
Unix期末考试总结--针对直系
[MySQL basics] startup options and configuration files
阅读笔记:Meta Matrix Factorization for Federated Rating Predictions
Oracle Performance Analysis Tool: oswatcher
Number of stair climbing methods of leetcode
Use the SED command to process text efficiently
PHP background parsing after JQ serialization