当前位置:网站首页>Es6--- two methods of capturing promise status as failed
Es6--- two methods of capturing promise status as failed
2022-07-06 15:27:00 【Cirrod】
1.try cath Method
async fn() {
try {
await promise object
} catch (err) {
console.log(err)// Capture failed promise
}
}2. adopt promise The built-in .catch() Method
async fn() {
await promise object .catch(err => {
console.log(err)// Capture failed promise
})
}边栏推荐
- Mysql database (II) DML data operation statements and basic DQL statements
- 学习记录:如何进行PWM 输出
- LeetCode#118. Yanghui triangle
- What is "test paper test" in software testing requirements analysis
- ucore lab7
- Programmers, how to avoid invalid meetings?
- How to change XML attribute - how to change XML attribute
- ucore lab5用户进程管理 实验报告
- Sorting odd and even subscripts respectively for leetcode simple problem
- MySQL数据库(三)高级数据查询语句
猜你喜欢

Introduction to safety testing
遇到程序员不修改bug时怎么办?我教你

C4D quick start tutorial - Introduction to software interface

Rearrange spaces between words in leetcode simple questions
![[pytorch] simple use of interpolate](/img/16/87aa8a49e60801404822fe644e70c8.jpg)
[pytorch] simple use of interpolate

How to rename multiple folders and add unified new content to folder names

Lab 8 文件系统

FSM and I2C experiment report

Stc-b learning board buzzer plays music

Investment operation steps
随机推荐
Collection集合与Map集合
全网最详细的postman接口测试教程,一篇文章满足你
Winter vacation daily question - maximum number of balloons
Stc-b learning board buzzer plays music 2.0
Capitalize the title of leetcode simple question
What to do when programmers don't modify bugs? I teach you
Stm32 dossiers d'apprentissage: saisie des applications
软件测试有哪些常用的SQL语句?
[200 opencv routines] 98 Statistical sorting filter
Investment operation steps
学习记录:如何进行PWM 输出
pytest
UCORE LaB6 scheduler experiment report
FSM and I2C experiment report
软件测试面试要问的性能测试术语你知道吗?
Preface to the foundations of Hilbert geometry
Currently, mysql5.6 is used. Which version would you like to upgrade to?
Eigen User Guide (Introduction)
Pedestrian re identification (Reid) - data set description market-1501
ucore lab5用户进程管理 实验报告