当前位置:网站首页>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的事务
- UCORE lab5 user process management experiment report
- Leetcode simple question: check whether two strings are almost equal
- Introduction to safety testing
- Jupyter installation and use tutorial
- LeetCode#198. raid homes and plunder houses
- Interface test interview questions and reference answers, easy to grasp the interviewer
- Collection集合与Map集合
- 接口测试面试题及参考答案,轻松拿捏面试官
- STM32 learning record: input capture application
猜你喜欢
LeetCode#19. Delete the penultimate node of the linked list
How to do agile testing in automated testing?
Crawler series of learning while tapping (3): URL de duplication strategy and Implementation
Unpleasant error typeerror: cannot perform 'ROR_‘ with a dtyped [float64] array and scalar of type [bool]
How to build a nail robot that can automatically reply
转行软件测试必需要知道的知识
Es6---es6 content details
Knowledge that you need to know when changing to software testing
软件测试有哪些常用的SQL语句?
線程及線程池
随机推荐
Want to change jobs? Do you know the seven skills you need to master in the interview software test
JDBC介绍
Maximum nesting depth of parentheses in leetcode simple questions
接口测试面试题及参考答案,轻松拿捏面试官
如何成为一个好的软件测试员?绝大多数人都不知道的秘密
How to become a good software tester? A secret that most people don't know
Eslint--- error: newline required at end of file but not found (EOL last) solution
ucore lab7
Mysql database (II) DML data operation statements and basic DQL statements
Mysql database (III) advanced data query statement
Leetcode notes - dynamic planning -day7
Iterators and generators
The minimum number of operations to convert strings in leetcode simple problem
学习记录:如何进行PWM 输出
In Oracle, start with connect by prior recursive query is used to query multi-level subordinate employees.
The most detailed postman interface test tutorial in the whole network. An article meets your needs
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
Take you to use wxpy to create your own chat robot (plus wechat interface basic data visualization)
Crawling cat's eye movie review, data visualization analysis source code operation instructions