当前位置:网站首页>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
边栏推荐
- Oracle Net Service:监听器与服务名解析方法
- 使用百度智能云人脸检测接口实现照片质量检测
- Virtio and Vhost_ Net introduction
- 【不积跬步无以至千里】Oracle应用导数Ora-01455报错处理
- Each traversal usage of tp6
- PHP unlimited classification and tree
- How to use tiup to deploy a tidb V5 0 cluster
- rdma网络介绍
- [OSS file upload quick start]
- Usage of if conditional statements in SQL
猜你喜欢
随机推荐
Solution to page cache problem (use with caution)
Binary sum of leetcode questions
Oracle net service: listener and service name resolution method
SQL学习|基础查询与排列
Imitation scallop essay reading page
异常记录-9
DDOS攻击/防御介绍
[OSS file upload quick start]
【MySQL基础篇】启动选项、系统变量、状态变量
Common views of Oracle database performance analysis
异常记录-21
MySQL server standalone deployment manual
Typescript (top)
rdma 介绍
MySQL【ACID+隔离级别+ redo log + undo log】
ES入门学习笔记
用反射与注解获取两个不同对象间的属性值差异
阅读笔记:Secure Federated Matrix Factorization
How to use tiup to deploy a tidb V5 0 cluster
Installing redis using a small leather panel in the window environment





![[ES6 quick start]](/img/9e/4c4be5907c1f7b3485c2f4178b9150.png)



