Skip to content

Commit 84575bc

Browse files
committed
优化异常输出
1 parent 7adadc7 commit 84575bc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/utils.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,11 @@ export function getLocalFileInfo(localKey: string): LocalInfo | null {
7474

7575
let localInfo: LocalInfo | null = null
7676
try { localInfo = JSON.parse(localInfoString) }
77-
catch { removeLocalFileInfo(localKey) } // 本地信息已被破坏,直接删除
77+
catch {
78+
// 本地信息已被破坏,直接删除
79+
removeLocalFileInfo(localKey)
80+
throw new Error(`getLocalFileInfo failed to parse. key: ${localKey}`)
81+
}
7882

7983
return localInfo
8084
}

0 commit comments

Comments
 (0)