当前位置:网站首页>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
})
}边栏推荐
- What to do when programmers don't modify bugs? I teach you
- ucore lab8 文件系统 实验报告
- Sorting odd and even subscripts respectively for leetcode simple problem
- 如何成为一个好的软件测试员?绝大多数人都不知道的秘密
- LeetCode#268. Missing numbers
- JS --- all basic knowledge of JS (I)
- Servlet
- Brief description of compiler optimization level
- Dlib detects blink times based on video stream
- Mysql database (II) DML data operation statements and basic DQL statements
猜你喜欢
How to do agile testing in automated testing?

Winter vacation daily question - maximum number of balloons

软件测试Bug报告怎么写?

Flex --- detailed explanation of flex layout attributes

LeetCode#19. Delete the penultimate node of the linked list

Brief description of compiler optimization level

JS --- BOM details of JS (V)

如何成为一个好的软件测试员?绝大多数人都不知道的秘密

Crawler series of learning while tapping (3): URL de duplication strategy and Implementation

ucore lab 2
随机推荐
Investment operation steps
MySQL数据库(一)
LeetCode#53. Maximum subarray sum
JDBC介绍
LeetCode#412. Fizz Buzz
Crawling cat's eye movie review, data visualization analysis source code operation instructions
MySQL数据库(二)DML数据操作语句和基本的DQL语句
Servlet
The number of reversing twice in leetcode simple question
LeetCode#268. Missing numbers
学习记录:如何进行PWM 输出
What is "test paper test" in software testing requirements analysis
What to do when programmers don't modify bugs? I teach you
接口测试面试题及参考答案,轻松拿捏面试官
Example 071 simulates a vending machine, designs a program of the vending machine, runs the program, prompts the user, enters the options to be selected, and prompts the selected content after the use
Mysql database (III) advanced data query statement
ArrayList set
The latest query tracks the express logistics and analyzes the method of delivery timeliness
Want to change jobs? Do you know the seven skills you need to master in the interview software test
Leetcode simple question: check whether two strings are almost equal