From 19cb26da92fe05f1eb1c0dd7268067cbc9b5421d Mon Sep 17 00:00:00 2001 From: Robert Knight Date: Tue, 19 Nov 2013 09:13:19 +0000 Subject: 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' --- error_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'error_test.go') diff --git a/error_test.go b/error_test.go index afa7b27..b3f8447 100644 --- a/error_test.go +++ b/error_test.go @@ -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() == "" { -- cgit v1.2.3