diff --git a/db/create_test.go b/db/create_test.go index 2b8a938d..011c30f4 100644 --- a/db/create_test.go +++ b/db/create_test.go @@ -64,7 +64,7 @@ func TestCreate(t *testing.T) { So(res, ShouldHaveLength, 3) So(res[1].Result, ShouldHaveLength, 1) So(res[2].Result, ShouldHaveLength, 0) - So(res[2].Status, ShouldEqual, "ERR_KV") + So(res[2].Status, ShouldEqual, "ERR_EX") So(res[2].Detail, ShouldEqual, "Database record 'person:test' already exists") }) @@ -272,15 +272,15 @@ func TestCreate(t *testing.T) { So(err, ShouldBeNil) So(res, ShouldHaveLength, 8) So(res[1].Result, ShouldHaveLength, 1) - So(res[2].Status, ShouldEqual, "ERR_KV") + So(res[2].Status, ShouldEqual, "ERR_EX") So(res[2].Detail, ShouldEqual, "Database record 'person:1' already exists") - So(res[3].Status, ShouldEqual, "ERR_KV") + So(res[3].Status, ShouldEqual, "ERR_EX") So(res[3].Detail, ShouldEqual, "Database record 'person:1' already exists") - So(res[4].Status, ShouldEqual, "ERR_KV") + So(res[4].Status, ShouldEqual, "ERR_EX") So(res[4].Detail, ShouldEqual, "Database record 'person:1' already exists") - So(res[5].Status, ShouldEqual, "ERR_KV") + So(res[5].Status, ShouldEqual, "ERR_EX") So(res[5].Detail, ShouldEqual, "Database record 'person:1' already exists") - So(res[6].Status, ShouldEqual, "ERR_KV") + So(res[6].Status, ShouldEqual, "ERR_EX") So(res[6].Detail, ShouldEqual, "Database record 'person:1' already exists") So(res[7].Result, ShouldHaveLength, 1) diff --git a/db/executor.go b/db/executor.go index 0947000d..0f0e8519 100644 --- a/db/executor.go +++ b/db/executor.go @@ -488,7 +488,7 @@ func status(e error) (s string) { case *PermsError: return "ERR_PE" case *ExistError: - return "ERR_KV" + return "ERR_EX" case *FieldError: return "ERR_FD" case *IndexError: diff --git a/db/insert_test.go b/db/insert_test.go index 03a1bc0d..56e47205 100644 --- a/db/insert_test.go +++ b/db/insert_test.go @@ -146,7 +146,7 @@ func TestInsert(t *testing.T) { So(res[2].Result, ShouldHaveLength, 1) So(data.Consume(res[2].Result[0]).Get("login").Data(), ShouldEqual, "joe") So(data.Consume(res[2].Result[0]).Get("meta.id").Data(), ShouldEqual, 360) - So(res[3].Status, ShouldEqual, "ERR_KV") + So(res[3].Status, ShouldEqual, "ERR_EX") So(res[3].Detail, ShouldEqual, "Database record 'users:360' already exists") So(res[4].Result, ShouldHaveLength, 1) So(data.Consume(res[4].Result[0]).Get("login").Data(), ShouldEqual, "joe") @@ -203,7 +203,7 @@ func TestInsert(t *testing.T) { So(data.Consume(res[2].Result[1]).Get("meta.id").Data(), ShouldEqual, 200) So(data.Consume(res[2].Result[2]).Get("login").Data(), ShouldEqual, "tester") So(data.Consume(res[2].Result[2]).Get("meta.id").Data(), ShouldEqual, "test") - So(res[3].Status, ShouldEqual, "ERR_KV") + So(res[3].Status, ShouldEqual, "ERR_EX") So(res[4].Result, ShouldHaveLength, 3) So(data.Consume(res[4].Result[0]).Get("login").Data(), ShouldEqual, "mike") So(data.Consume(res[4].Result[0]).Get("meta.id").Data(), ShouldEqual, 200)