首页 新闻 会员 周边

typescript: 如何获取异常信息

0
悬赏园豆:30 解决于 2023-12-13 12:28

下面的代码会造成 eslint 报错

try {
    // ...
} catch (e) {
    console.log('错误信息:' + e)
}

eslint 报错信息如下

Invalid operand for a '+' operation. Operands must each be a number or string, allowing a string + any of: `boolean`, `null`, `RegExp`, `undefined`. Got `unknown`.
dudu的主页 dudu | 高人七级 | 园豆:23366
提问于:2023-12-13 08:17
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册