aboutsummaryrefslogtreecommitdiff
path: root/error_test.go
diff options
context:
space:
mode:
authorRobert Knight <robertknight@gmail.com>2013-11-19 09:13:19 +0000
committerRobert Knight <robertknight@gmail.com>2013-11-19 09:13:19 +0000
commit19cb26da92fe05f1eb1c0dd7268067cbc9b5421d (patch)
treeaaea643f22972381b5c6420efb5235ce0ae8df38 /error_test.go
parentMerge pull request #88 from hattya/close_v2 (diff)
downloadgolite-19cb26da92fe05f1eb1c0dd7268067cbc9b5421d.tar.gz
golite-19cb26da92fe05f1eb1c0dd7268067cbc9b5421d.tar.xz
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'
Diffstat (limited to 'error_test.go')
-rw-r--r--error_test.go2
1 files changed, 1 insertions, 1 deletions
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() == "" {