mirror of
https://github.com/servalproject/serval-dna.git
synced 2024-12-19 05:07:56 +00:00
Add logging for sqlite errors
This commit is contained in:
parent
c7cf80b352
commit
7978bc0b1a
@ -156,6 +156,10 @@ int (*sqlite_set_tracefunc(int (*newfunc)()))()
|
||||
return oldfunc;
|
||||
}
|
||||
|
||||
void sqlite_log(void *ignored, int result, const char *msg){
|
||||
WARNF("Sqlite: %d %s", result, msg);
|
||||
}
|
||||
|
||||
/*
|
||||
* The MANIFESTS table 'author' column records the cryptographically verified SID of the author
|
||||
* that has write permission on the bundle, ie, possesses the Rhizome secret key that generated the
|
||||
@ -194,6 +198,8 @@ int rhizome_opendb()
|
||||
RETURN(WHY("Invalid path"));
|
||||
}
|
||||
|
||||
sqlite3_config(SQLITE_CONFIG_LOG,sqlite_log,NULL);
|
||||
|
||||
if (sqlite3_open(dbpath,&rhizome_db)){
|
||||
RETURN(WHYF("SQLite could not open database %s: %s", dbpath, sqlite3_errmsg(rhizome_db)));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user