Provide more detailed error messages

Use the sqlite3_errmsg() API to retrieve more specific error
messages.

eg. Attempting to exec 'CREATE TABLE ExistingTableName (...)'
will now report 'table already exists: ExistingTableName' rather
than 'SQL logic error or missing database'
This commit is contained in:
Robert Knight
2013-11-19 09:13:19 +00:00
parent 056b49918a
commit 19cb26da92
3 changed files with 35 additions and 15 deletions

View File

@@ -27,7 +27,7 @@ func TestFailures(t *testing.T) {
if err == nil {
_, err = db.Exec("drop table foo")
}
if err != ErrNotADB {
if err.Code != ErrNotADB {
t.Error("wrong error code for corrupted DB")
}
if err.Error() == "" {