mirror of https://github.com/waku-org/nwaku.git
chore: sqlite make sure code is always run (#2891)
This commit is contained in:
parent
e1518cf9ff
commit
4ac4ab2a41
|
@ -234,6 +234,8 @@ proc query*(
|
|||
return err($sqlite3_errstr(v))
|
||||
return ok gotResults
|
||||
except Exception, CatchableError:
|
||||
error "exception in query", query = query, error = getCurrentExceptionMsg()
|
||||
|
||||
# release implicit transaction
|
||||
discard sqlite3_reset(s) # same return information as step
|
||||
discard sqlite3_clear_bindings(s) # no errors possible
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
{.push raises: [].}
|
||||
|
||||
import std/[options, sequtils], stew/byteutils, sqlite3_abi, results
|
||||
import chronicles
|
||||
import
|
||||
../../../common/databases/db_sqlite,
|
||||
../../../common/databases/common,
|
||||
|
@ -427,6 +428,9 @@ proc execSelectMessagesV2WithLimitStmt(
|
|||
else:
|
||||
return err($sqlite3_errstr(v))
|
||||
except Exception, CatchableError:
|
||||
error "exception in execSelectMessagesV2WithLimitStmt",
|
||||
error = getCurrentExceptionMsg()
|
||||
|
||||
# release implicit transaction
|
||||
discard sqlite3_reset(s) # same return information as step
|
||||
discard sqlite3_clear_bindings(s) # no errors possible
|
||||
|
@ -498,6 +502,8 @@ proc execSelectMessageByHash(
|
|||
else:
|
||||
return err($sqlite3_errstr(v))
|
||||
except Exception, CatchableError:
|
||||
error "exception in execSelectMessageByHash", error = getCurrentExceptionMsg()
|
||||
|
||||
# release implicit transaction
|
||||
discard sqlite3_reset(s) # same return information as step
|
||||
discard sqlite3_clear_bindings(s) # no errors possible
|
||||
|
@ -629,6 +635,9 @@ proc execSelectMessagesWithLimitStmt(
|
|||
else:
|
||||
return err($sqlite3_errstr(v))
|
||||
except Exception, CatchableError:
|
||||
error "exception in execSelectMessagesWithLimitStmt",
|
||||
error = getCurrentExceptionMsg()
|
||||
|
||||
# release implicit transaction
|
||||
discard sqlite3_reset(s) # same return information as step
|
||||
discard sqlite3_clear_bindings(s) # no errors possible
|
||||
|
|
Loading…
Reference in New Issue