mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-04 15:58:49 +01:00
♻️ 将退出码移到 logging 项目中
This commit is contained in:
parent
e99b7fd588
commit
2601605953
13 changed files with 29 additions and 39 deletions
|
|
@ -491,7 +491,7 @@ func fullReindex() {
|
|||
WaitForWritingFiles()
|
||||
|
||||
if err := sql.InitDatabase(true); nil != err {
|
||||
os.Exit(util.ExitCodeReadOnlyDatabase)
|
||||
os.Exit(logging.ExitCodeReadOnlyDatabase)
|
||||
return
|
||||
}
|
||||
treenode.InitBlockTree(true)
|
||||
|
|
|
|||
|
|
@ -463,7 +463,7 @@ func Close(force bool, execInstallPkg int) (exitCode int) {
|
|||
}
|
||||
logging.LogInfof("exited kernel")
|
||||
util.WebSocketServer.Close()
|
||||
os.Exit(util.ExitCodeOk)
|
||||
os.Exit(logging.ExitCodeOk)
|
||||
}()
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue