mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
♻️ 将退出码移到 logging 项目中
This commit is contained in:
parent
e99b7fd588
commit
2601605953
13 changed files with 29 additions and 39 deletions
|
|
@ -1148,7 +1148,7 @@ func beginTx() (tx *sql.Tx, err error) {
|
|||
if tx, err = db.Begin(); nil != err {
|
||||
logging.LogErrorf("begin tx failed: %s\n %s", err, logging.ShortStack())
|
||||
if strings.Contains(err.Error(), "database is locked") {
|
||||
os.Exit(util.ExitCodeReadOnlyDatabase)
|
||||
os.Exit(logging.ExitCodeReadOnlyDatabase)
|
||||
}
|
||||
}
|
||||
return
|
||||
|
|
@ -1158,7 +1158,7 @@ func beginHistoryTx() (tx *sql.Tx, err error) {
|
|||
if tx, err = historyDB.Begin(); nil != err {
|
||||
logging.LogErrorf("begin history tx failed: %s\n %s", err, logging.ShortStack())
|
||||
if strings.Contains(err.Error(), "database is locked") {
|
||||
os.Exit(util.ExitCodeReadOnlyDatabase)
|
||||
os.Exit(logging.ExitCodeReadOnlyDatabase)
|
||||
}
|
||||
}
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue