Raise the "database locked" error from caller context

This commit is contained in:
df 2020-10-18 19:19:26 +00:00
parent 3981bbd37e
commit 13f3b1ccce

View File

@ -62,8 +62,14 @@ proc {settings _safer_query} { queryText args } {
try {
return [$settingsdb query $queryText {*}$arg]
} on error {msg opts} {
if {[string first "database is locked" $msg] >= 0 && [incr lockCnt -1] > 0} {
continue
if {[string first "database is locked" $msg] >= 0} {
if {[incr lockCnt -1] > 0} {
continue
} else {
# raise error from caller
set msg "Persistently unable to access Settings: database locked"
incr opts(-level)
}
}
return {*}$opts $msg
}