mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
entc/gen: use NotFoundError when updating non-exist node (#348)
Fixes #341
This commit is contained in:
@@ -184,6 +184,10 @@ func Sanity(t *testing.T, client *ent.Client) {
|
||||
usr = client.User.UpdateOne(usr).SetName("baz").AddGroups(grp).SaveX(ctx)
|
||||
require.Equal("baz", usr.Name)
|
||||
require.NotEmpty(usr.QueryGroups().AllX(ctx))
|
||||
// update unknown vertex.
|
||||
_, err := client.User.UpdateOneID(usr.ID + usr.ID).SetName("foo").Save(ctx)
|
||||
require.Error(err)
|
||||
require.True(ent.IsNotFound(err))
|
||||
|
||||
// grouping.
|
||||
var v []struct {
|
||||
|
||||
Reference in New Issue
Block a user