try catch

作者: 晚溪呀 | 来源:发表于2019-03-17 21:34 被阅读0次
    try {
        // 错误信息会被 error 捕获
    } catch (error) {
        // 会在这里显示
    }

throw Error 抛出错误
Error 也是一个对象
catch /kætʃ/ 捕获
try /traɪ/ 尝试,努力
throw /θrəʊ/
props /prɒps/ 属性

相关文章

网友评论

      本文标题:try catch

      本文链接:https://www.haomeiwen.com/subject/trypmqtx.html