From 4db1bbe94438c064a400b4382cd107e76a6cf6c0 Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Tue, 1 Nov 2016 22:57:27 +0000 Subject: [PATCH] Improve sql query error messages --- db/create.go | 2 +- db/delete.go | 2 +- db/update.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/db/create.go b/db/create.go index 0db2bd2f..bb9711f1 100644 --- a/db/create.go +++ b/db/create.go @@ -36,7 +36,7 @@ func (e *executor) executeCreateStatement(txn kvs.TX, ast *sql.CreateStatement) switch what := w.(type) { default: - return out, fmt.Errorf("Can not execute CREATE query using type '%T'", what) + return out, fmt.Errorf("Can not execute CREATE query using value '%v' with type '%T'", what, what) case *sql.Thing: key := &keys.Thing{KV: ast.KV, NS: ast.NS, DB: ast.DB, TB: what.TB, ID: what.ID} diff --git a/db/delete.go b/db/delete.go index 475a8146..a263aed7 100644 --- a/db/delete.go +++ b/db/delete.go @@ -35,7 +35,7 @@ func (e *executor) executeDeleteStatement(txn kvs.TX, ast *sql.DeleteStatement) switch what := w.(type) { default: - return out, fmt.Errorf("Can not execute DELETE query using type '%T'", what) + return out, fmt.Errorf("Can not execute DELETE query using value '%v' with type '%T'", what, what) case *sql.Thing: key := &keys.Thing{KV: ast.KV, NS: ast.NS, DB: ast.DB, TB: what.TB, ID: what.ID} diff --git a/db/update.go b/db/update.go index a6abf3ec..3f12c17d 100644 --- a/db/update.go +++ b/db/update.go @@ -35,7 +35,7 @@ func (e *executor) executeUpdateStatement(txn kvs.TX, ast *sql.UpdateStatement) switch what := w.(type) { default: - return out, fmt.Errorf("Can not execute UPDATE query using type '%T'", what) + return out, fmt.Errorf("Can not execute UPDATE query using value '%v' with type '%T'", what, what) case *sql.Thing: key := &keys.Thing{KV: ast.KV, NS: ast.NS, DB: ast.DB, TB: what.TB, ID: what.ID}