当前位置:网站首页>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
})
}
边栏推荐
- Emqtt distribution cluster and node bridge construction
- Introduction to safety testing
- Crawling cat's eye movie review, data visualization analysis source code operation instructions
- Brief description of compiler optimization level
- The number of reversing twice in leetcode simple question
- 想跳槽?面试软件测试需要掌握的7个技能你知道吗
- Pedestrian re identification (Reid) - Overview
- Learning record: Tim - capacitive key detection
- Heap, stack, queue
- Collection集合与Map集合
猜你喜欢
Want to change jobs? Do you know the seven skills you need to master in the interview software test
csapp shell lab
学习记录:使用STM32外部输入中断
What is "test paper test" in software testing requirements analysis
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
Leetcode notes - dynamic planning -day7
C4D quick start tutorial - Introduction to software interface
FSM and I2C experiment report
The minimum sum of the last four digits of the split digit of leetcode simple problem
Stc-b learning board buzzer plays music
随机推荐
Automated testing problems you must understand, boutique summary
Word macro operation: convert the automatic number in the document into editable text type
学习记录:如何进行PWM 输出
Thinking about three cups of tea
The maximum number of words in the sentence of leetcode simple question
LeetCode#204. Count prime
Sorting odd and even subscripts respectively for leetcode simple problem
转行软件测试必需要知道的知识
pytest
Brief description of compiler optimization level
Introduction to safety testing
学习记录:TIM—基本定时器
软件测试面试要问的性能测试术语你知道吗?
Crawler series of learning while tapping (3): URL de duplication strategy and Implementation
Pedestrian re identification (Reid) - Overview
Programmers, how to avoid invalid meetings?
Currently, mysql5.6 is used. Which version would you like to upgrade to?
The minimum number of operations to convert strings in leetcode simple problem
Which version of MySQL does php7 work best with?
Dlib detects blink times based on video stream