♻️ 将退出码移到 logging 项目中

This commit is contained in:
Liang Ding 2023-03-18 18:10:06 +08:00
parent e99b7fd588
commit 2601605953
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
13 changed files with 29 additions and 39 deletions

View file

@ -42,7 +42,7 @@ func LoadTree(boxID, p string, luteEngine *lute.Lute) (ret *parse.Tree, err erro
if nil != err {
logging.LogErrorf("load tree [%s] failed: %s", p, err)
if errors.Is(err, filelock.ErrUnableAccessFile) {
os.Exit(util.ExitCodeFileSysInconsistent)
os.Exit(logging.ExitCodeFileSysInconsistent)
return
}
return
@ -97,7 +97,7 @@ 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)
os.Exit(logging.ExitCodeFileSysInconsistent)
return
}
}