♻️ 将退出码移到 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

@ -260,7 +260,7 @@ func setCriteria(criteria []*Criterion) (err error) {
if nil != err {
logging.LogErrorf("write storage [criteria] failed: %s", err)
if errors.Is(err, filelock.ErrUnableAccessFile) {
os.Exit(util.ExitCodeFileSysInconsistent)
os.Exit(logging.ExitCodeFileSysInconsistent)
return
}
return
@ -279,7 +279,7 @@ func getCriteria() (ret []*Criterion, err error) {
if nil != err {
logging.LogErrorf("read storage [criteria] failed: %s", err)
if errors.Is(err, filelock.ErrUnableAccessFile) {
os.Exit(util.ExitCodeFileSysInconsistent)
os.Exit(logging.ExitCodeFileSysInconsistent)
return
}
return
@ -354,7 +354,7 @@ func setLocalStorage(val interface{}) (err error) {
if nil != err {
logging.LogErrorf("write storage [local] failed: %s", err)
if errors.Is(err, filelock.ErrUnableAccessFile) {
os.Exit(util.ExitCodeFileSysInconsistent)
os.Exit(logging.ExitCodeFileSysInconsistent)
return
}
return
@ -373,7 +373,7 @@ func getLocalStorage() (ret map[string]interface{}, err error) {
if nil != err {
logging.LogErrorf("read storage [local] failed: %s", err)
if errors.Is(err, filelock.ErrUnableAccessFile) {
os.Exit(util.ExitCodeFileSysInconsistent)
os.Exit(logging.ExitCodeFileSysInconsistent)
return
}
return