Closed Iceberry-qdd closed 1 month ago
目前正在修复,报错时,将不会打印日志,具体变更如下:
[修改前]
try {
const response = await fetchSth()
if (!response.ok) throw new Error((await response.json()).error)
...
} catch(e) {
store.setErrorMsg(e.message)
console.error(e)
}
[修改后]
try {
const response = await fetchSth()
if (!response.ok) throw new Error((await response.json()).error)
...
} catch(e) {
store.setErrorMsg(e.message)
}
如下代码:
https://github.com/Iceberry-qdd/icehub-frontend/blob/a37f32e334744f52071fdac2845c6d2b69a3045d/src/components/bootstrap/Explore.vue#L56-L65
以下两种代码,哪一种是正确的呢?
e
代表的是后端返回的error
对象才对吧,而不是error
对象中的error
属性?第一种
第二种