🎨 使用第三方同步盘时弹出提示并退出内核 https://github.com/siyuan-note/siyuan/issues/7683

This commit is contained in:
Liang Ding 2023-03-17 16:29:50 +08:00
parent f2f60cf9fe
commit 5971076749
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
3 changed files with 39 additions and 16 deletions

View file

@ -41,6 +41,10 @@ func LoadTree(boxID, p string, luteEngine *lute.Lute) (ret *parse.Tree, err erro
data, err := filelock.ReadFile(filePath)
if nil != err {
logging.LogErrorf("load tree [%s] failed: %s", p, err)
if errors.Is(err, filelock.ErrUnableAccessFile) {
os.Exit(util.ExitCodeFileSysInconsistent)
return
}
return
}
@ -92,6 +96,10 @@ func LoadTreeByData(data []byte, boxID, p string, luteEngine *lute.Lute) (ret *p
}
} else {
logging.LogWarnf("read parent tree data [%s] failed: %s", parentAbsPath, readErr)
if errors.Is(readErr, filelock.ErrUnableAccessFile) {
os.Exit(util.ExitCodeFileSysInconsistent)
return
}
}
hPathBuilder.WriteString("Untitled/")
continue