当前位置:网站首页>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
})
}
边栏推荐
- LeetCode#198. raid homes and plunder houses
- 基于485总线的评分系统
- Servlet
- The most detailed postman interface test tutorial in the whole network. An article meets your needs
- Mysql database (I)
- Preface to the foundations of Hilbert geometry
- ucore lab8 文件系统 实验报告
- Mysql database (V) views, stored procedures and triggers
- JS --- all basic knowledge of JS (I)
- ucore lab7 同步互斥 实验报告
猜你喜欢
ucore lab 2
Heap, stack, queue
Brief introduction to libevent
Threads and thread pools
安全测试入门介绍
学习记录:使用STM32F1看门狗
Interview answering skills for software testing
UCORE lab1 system software startup process experimental report
What is "test paper test" in software testing requirements analysis
UCORE LaB6 scheduler experiment report
随机推荐
ucore lab6 调度器 实验报告
What if software testing is too busy to study?
Stc-b learning board buzzer plays music 2.0
Nest and merge new videos, and preset new video titles
接口测试面试题及参考答案,轻松拿捏面试官
Portapack application development tutorial (XVII) nRF24L01 launch B
LeetCode#19. Delete the penultimate node of the linked list
Sorting odd and even subscripts respectively for leetcode simple problem
[pytorch] simple use of interpolate
遇到程序员不修改bug时怎么办?我教你
LeetCode#62. Different paths
LeetCode#2062. Count vowel substrings in strings
In Oracle, start with connect by prior recursive query is used to query multi-level subordinate employees.
Investment should be calm
Learning record: Tim - capacitive key detection
ArrayList集合
LeetCode#198. raid homes and plunder houses
Contest3145 - the 37th game of 2021 freshman individual training match_ A: Prizes
What are the software testing methods? Show you something different
学习记录:如何进行PWM 输出