From 195be2d98d88c95c93c875ff8e099312701d5adf Mon Sep 17 00:00:00 2001 From: "Giau. Tran Minh" Date: Tue, 14 Jun 2022 16:32:46 +0700 Subject: [PATCH] entc/gen: fixed unnamed field initialization (#2648) * entc/gen: fixed ConstraintError fields name * fix: run go generate * entc/gen: fixed Filter fields name * fix: run go generate again for entql --- entc/gen/template/dialect/sql/create.tmpl | 4 +- entc/gen/template/dialect/sql/entql.tmpl | 6 +- entc/gen/template/dialect/sql/update.tmpl | 2 +- .../cascadelete/ent/comment_create.go | 4 +- .../cascadelete/ent/comment_update.go | 4 +- .../cascadelete/ent/post_create.go | 4 +- .../cascadelete/ent/post_update.go | 4 +- .../cascadelete/ent/user_create.go | 4 +- .../cascadelete/ent/user_update.go | 4 +- entc/integration/config/ent/user_create.go | 4 +- entc/integration/config/ent/user_update.go | 4 +- .../customid/ent/account_create.go | 4 +- .../customid/ent/account_update.go | 4 +- entc/integration/customid/ent/blob_create.go | 4 +- entc/integration/customid/ent/blob_update.go | 4 +- entc/integration/customid/ent/car_create.go | 4 +- entc/integration/customid/ent/car_update.go | 4 +- .../integration/customid/ent/device_create.go | 4 +- .../integration/customid/ent/device_update.go | 4 +- entc/integration/customid/ent/doc_create.go | 4 +- entc/integration/customid/ent/doc_update.go | 4 +- entc/integration/customid/ent/entql.go | 84 +++++++++---------- entc/integration/customid/ent/group_create.go | 4 +- entc/integration/customid/ent/group_update.go | 4 +- .../customid/ent/mixinid_create.go | 4 +- .../customid/ent/mixinid_update.go | 4 +- entc/integration/customid/ent/note_create.go | 4 +- entc/integration/customid/ent/note_update.go | 4 +- entc/integration/customid/ent/other_create.go | 4 +- entc/integration/customid/ent/other_update.go | 4 +- entc/integration/customid/ent/pet_create.go | 4 +- entc/integration/customid/ent/pet_update.go | 4 +- .../customid/ent/revision_create.go | 4 +- .../customid/ent/revision_update.go | 4 +- .../customid/ent/session_create.go | 4 +- .../customid/ent/session_update.go | 4 +- entc/integration/customid/ent/token_create.go | 4 +- entc/integration/customid/ent/token_update.go | 4 +- entc/integration/customid/ent/user_create.go | 4 +- entc/integration/customid/ent/user_update.go | 4 +- entc/integration/edgefield/ent/car_create.go | 4 +- entc/integration/edgefield/ent/car_update.go | 4 +- entc/integration/edgefield/ent/card_create.go | 4 +- entc/integration/edgefield/ent/card_update.go | 4 +- entc/integration/edgefield/ent/info_create.go | 4 +- entc/integration/edgefield/ent/info_update.go | 4 +- .../edgefield/ent/metadata_create.go | 4 +- .../edgefield/ent/metadata_update.go | 4 +- entc/integration/edgefield/ent/node_create.go | 4 +- entc/integration/edgefield/ent/node_update.go | 4 +- entc/integration/edgefield/ent/pet_create.go | 4 +- entc/integration/edgefield/ent/pet_update.go | 4 +- entc/integration/edgefield/ent/post_create.go | 4 +- entc/integration/edgefield/ent/post_update.go | 4 +- .../edgefield/ent/rental_create.go | 4 +- .../edgefield/ent/rental_update.go | 4 +- entc/integration/edgefield/ent/user_create.go | 4 +- entc/integration/edgefield/ent/user_update.go | 4 +- .../edgeschema/ent/friendship_create.go | 4 +- .../edgeschema/ent/friendship_update.go | 4 +- .../edgeschema/ent/group_create.go | 4 +- .../edgeschema/ent/group_update.go | 4 +- .../edgeschema/ent/relationship_create.go | 4 +- .../edgeschema/ent/relationship_update.go | 4 +- .../edgeschema/ent/tweet_create.go | 4 +- .../edgeschema/ent/tweet_update.go | 4 +- .../edgeschema/ent/tweetlike_create.go | 4 +- .../edgeschema/ent/tweetlike_update.go | 4 +- .../integration/edgeschema/ent/user_create.go | 4 +- .../integration/edgeschema/ent/user_update.go | 4 +- .../edgeschema/ent/usergroup_create.go | 4 +- .../edgeschema/ent/usergroup_update.go | 4 +- .../edgeschema/ent/usertweet_create.go | 4 +- .../edgeschema/ent/usertweet_update.go | 4 +- entc/integration/ent/card_create.go | 4 +- entc/integration/ent/card_update.go | 4 +- entc/integration/ent/comment_create.go | 4 +- entc/integration/ent/comment_update.go | 4 +- entc/integration/ent/entql.go | 84 +++++++++---------- entc/integration/ent/fieldtype_create.go | 4 +- entc/integration/ent/fieldtype_update.go | 4 +- entc/integration/ent/file_create.go | 4 +- entc/integration/ent/file_update.go | 4 +- entc/integration/ent/filetype_create.go | 4 +- entc/integration/ent/filetype_update.go | 4 +- entc/integration/ent/goods_create.go | 4 +- entc/integration/ent/goods_update.go | 4 +- entc/integration/ent/group_create.go | 4 +- entc/integration/ent/group_update.go | 4 +- entc/integration/ent/groupinfo_create.go | 4 +- entc/integration/ent/groupinfo_update.go | 4 +- entc/integration/ent/item_create.go | 4 +- entc/integration/ent/item_update.go | 4 +- entc/integration/ent/node_create.go | 4 +- entc/integration/ent/node_update.go | 4 +- entc/integration/ent/pet_create.go | 4 +- entc/integration/ent/pet_update.go | 4 +- entc/integration/ent/spec_create.go | 4 +- entc/integration/ent/spec_update.go | 4 +- entc/integration/ent/task_create.go | 4 +- entc/integration/ent/task_update.go | 4 +- entc/integration/ent/user_create.go | 4 +- entc/integration/ent/user_update.go | 4 +- entc/integration/hooks/ent/card_create.go | 4 +- entc/integration/hooks/ent/card_update.go | 4 +- entc/integration/hooks/ent/user_create.go | 4 +- entc/integration/hooks/ent/user_update.go | 4 +- entc/integration/idtype/ent/user_create.go | 4 +- entc/integration/idtype/ent/user_update.go | 4 +- entc/integration/json/ent/user_create.go | 4 +- entc/integration/json/ent/user_update.go | 4 +- entc/integration/migrate/entv1/car_create.go | 4 +- entc/integration/migrate/entv1/car_update.go | 4 +- .../migrate/entv1/conversion_create.go | 4 +- .../migrate/entv1/conversion_update.go | 4 +- .../migrate/entv1/customtype_create.go | 4 +- .../migrate/entv1/customtype_update.go | 4 +- entc/integration/migrate/entv1/user_create.go | 4 +- entc/integration/migrate/entv1/user_update.go | 4 +- entc/integration/migrate/entv2/car_create.go | 4 +- entc/integration/migrate/entv2/car_update.go | 4 +- .../migrate/entv2/conversion_create.go | 4 +- .../migrate/entv2/conversion_update.go | 4 +- .../migrate/entv2/customtype_create.go | 4 +- .../migrate/entv2/customtype_update.go | 4 +- .../integration/migrate/entv2/group_create.go | 4 +- .../integration/migrate/entv2/group_update.go | 4 +- .../integration/migrate/entv2/media_create.go | 4 +- .../integration/migrate/entv2/media_update.go | 4 +- entc/integration/migrate/entv2/pet_create.go | 4 +- entc/integration/migrate/entv2/pet_update.go | 4 +- entc/integration/migrate/entv2/user_create.go | 4 +- entc/integration/migrate/entv2/user_update.go | 4 +- .../migrate/versioned/group_create.go | 4 +- .../migrate/versioned/group_update.go | 4 +- .../migrate/versioned/user_create.go | 4 +- .../migrate/versioned/user_update.go | 4 +- .../multischema/ent/group_create.go | 4 +- .../multischema/ent/group_update.go | 4 +- .../integration/multischema/ent/pet_create.go | 4 +- .../integration/multischema/ent/pet_update.go | 4 +- .../multischema/ent/user_create.go | 4 +- .../multischema/ent/user_update.go | 4 +- entc/integration/privacy/ent/entql.go | 18 ++-- entc/integration/privacy/ent/task_create.go | 4 +- entc/integration/privacy/ent/task_update.go | 4 +- entc/integration/privacy/ent/team_create.go | 4 +- entc/integration/privacy/ent/team_update.go | 4 +- entc/integration/privacy/ent/user_create.go | 4 +- entc/integration/privacy/ent/user_update.go | 4 +- entc/integration/template/ent/group_create.go | 4 +- entc/integration/template/ent/group_update.go | 4 +- entc/integration/template/ent/pet_create.go | 4 +- entc/integration/template/ent/pet_update.go | 4 +- entc/integration/template/ent/user_create.go | 4 +- entc/integration/template/ent/user_update.go | 4 +- examples/edgeindex/ent/city_create.go | 4 +- examples/edgeindex/ent/city_update.go | 4 +- examples/edgeindex/ent/street_create.go | 4 +- examples/edgeindex/ent/street_update.go | 4 +- examples/entcpkg/ent/user_create.go | 4 +- examples/entcpkg/ent/user_update.go | 4 +- examples/fs/ent/file_create.go | 4 +- examples/fs/ent/file_update.go | 4 +- examples/m2m2types/ent/group_create.go | 4 +- examples/m2m2types/ent/group_update.go | 4 +- examples/m2m2types/ent/user_create.go | 4 +- examples/m2m2types/ent/user_update.go | 4 +- examples/m2mbidi/ent/user_create.go | 4 +- examples/m2mbidi/ent/user_update.go | 4 +- examples/m2mrecur/ent/user_create.go | 4 +- examples/m2mrecur/ent/user_update.go | 4 +- examples/o2m2types/ent/pet_create.go | 4 +- examples/o2m2types/ent/pet_update.go | 4 +- examples/o2m2types/ent/user_create.go | 4 +- examples/o2m2types/ent/user_update.go | 4 +- examples/o2mrecur/ent/node_create.go | 4 +- examples/o2mrecur/ent/node_update.go | 4 +- examples/o2o2types/ent/card_create.go | 4 +- examples/o2o2types/ent/card_update.go | 4 +- examples/o2o2types/ent/user_create.go | 4 +- examples/o2o2types/ent/user_update.go | 4 +- examples/o2obidi/ent/user_create.go | 4 +- examples/o2obidi/ent/user_update.go | 4 +- examples/o2orecur/ent/node_create.go | 4 +- examples/o2orecur/ent/node_update.go | 4 +- examples/privacyadmin/ent/user_create.go | 4 +- examples/privacyadmin/ent/user_update.go | 4 +- examples/privacytenant/ent/entql.go | 18 ++-- examples/privacytenant/ent/group_create.go | 4 +- examples/privacytenant/ent/group_update.go | 4 +- examples/privacytenant/ent/tenant_create.go | 4 +- examples/privacytenant/ent/tenant_update.go | 4 +- examples/privacytenant/ent/user_create.go | 4 +- examples/privacytenant/ent/user_update.go | 4 +- examples/start/ent/car_create.go | 4 +- examples/start/ent/car_update.go | 4 +- examples/start/ent/group_create.go | 4 +- examples/start/ent/group_update.go | 4 +- examples/start/ent/user_create.go | 4 +- examples/start/ent/user_update.go | 4 +- examples/traversal/ent/group_create.go | 4 +- examples/traversal/ent/group_update.go | 4 +- examples/traversal/ent/pet_create.go | 4 +- examples/traversal/ent/pet_update.go | 4 +- examples/traversal/ent/user_create.go | 4 +- examples/traversal/ent/user_update.go | 4 +- examples/version/ent/user_create.go | 4 +- examples/version/ent/user_update.go | 4 +- 209 files changed, 512 insertions(+), 512 deletions(-) diff --git a/entc/gen/template/dialect/sql/create.tmpl b/entc/gen/template/dialect/sql/create.tmpl index 49ee9c725..4e4de92f2 100644 --- a/entc/gen/template/dialect/sql/create.tmpl +++ b/entc/gen/template/dialect/sql/create.tmpl @@ -15,7 +15,7 @@ func ({{ $receiver }} *{{ $builder }}) sqlSave(ctx context.Context) (*{{ $.Name _node, _spec := {{ $receiver }}.createSpec() if err := sqlgraph.CreateNode(ctx, {{ $receiver }}.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -170,7 +170,7 @@ func ({{ $receiver }} *{{ $builder }}) Save(ctx context.Context) ([]*{{ $.Name } // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, {{ $receiver }}.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/gen/template/dialect/sql/entql.tmpl b/entc/gen/template/dialect/sql/entql.tmpl index 0704f3a79..b37a38316 100644 --- a/entc/gen/template/dialect/sql/entql.tmpl +++ b/entc/gen/template/dialect/sql/entql.tmpl @@ -82,7 +82,7 @@ type predicateAdder interface { // Filter returns a Filter implementation to apply filters on the {{ $builder }} builder. func ({{ $receiver }} *{{ $builder }}) Filter() *{{ $filter }} { - return &{{ $filter }}{ {{ $receiver }}.config, {{ $receiver}} } + return &{{ $filter }}{config: {{ $receiver }}.config, predicateAdder: {{ $receiver}} } } // addPredicate implements the predicateAdder interface. @@ -92,13 +92,13 @@ type predicateAdder interface { // Filter returns an entql.Where implementation to apply filters on the {{ $mutation }} builder. func (m *{{ $mutation }}) Filter() *{{ $filter }} { - return &{{ $filter }}{m.config, m} + return &{{ $filter }}{config: m.config, predicateAdder: m} } // {{ $filter }} provides a generic filtering capability at runtime for {{ $builder }}. type {{ $filter }} struct { - config predicateAdder + config } // Where applies the entql predicate on the query filter. diff --git a/entc/gen/template/dialect/sql/update.tmpl b/entc/gen/template/dialect/sql/update.tmpl index 05f646149..7a45bc255 100644 --- a/entc/gen/template/dialect/sql/update.tmpl +++ b/entc/gen/template/dialect/sql/update.tmpl @@ -135,7 +135,7 @@ func ({{ $receiver }} *{{ $builder }}) sqlSave(ctx context.Context) ({{ $ret }} if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{ {{ $.Package }}.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return {{ $zero }}, err } diff --git a/entc/integration/cascadelete/ent/comment_create.go b/entc/integration/cascadelete/ent/comment_create.go index 3c8b8ec3b..b8b9b726a 100644 --- a/entc/integration/cascadelete/ent/comment_create.go +++ b/entc/integration/cascadelete/ent/comment_create.go @@ -133,7 +133,7 @@ func (cc *CommentCreate) sqlSave(ctx context.Context) (*Comment, error) { _node, _spec := cc.createSpec() if err := sqlgraph.CreateNode(ctx, cc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -216,7 +216,7 @@ func (ccb *CommentCreateBulk) Save(ctx context.Context) ([]*Comment, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ccb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/cascadelete/ent/comment_update.go b/entc/integration/cascadelete/ent/comment_update.go index c926c97cb..fd6b149ad 100644 --- a/entc/integration/cascadelete/ent/comment_update.go +++ b/entc/integration/cascadelete/ent/comment_update.go @@ -192,7 +192,7 @@ func (cu *CommentUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{comment.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -400,7 +400,7 @@ func (cuo *CommentUpdateOne) sqlSave(ctx context.Context) (_node *Comment, err e if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{comment.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/cascadelete/ent/post_create.go b/entc/integration/cascadelete/ent/post_create.go index 6bbee2303..19fe8f963 100644 --- a/entc/integration/cascadelete/ent/post_create.go +++ b/entc/integration/cascadelete/ent/post_create.go @@ -168,7 +168,7 @@ func (pc *PostCreate) sqlSave(ctx context.Context) (*Post, error) { _node, _spec := pc.createSpec() if err := sqlgraph.CreateNode(ctx, pc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -271,7 +271,7 @@ func (pcb *PostCreateBulk) Save(ctx context.Context) ([]*Post, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, pcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/cascadelete/ent/post_update.go b/entc/integration/cascadelete/ent/post_update.go index 84fcbf143..81ad03070 100644 --- a/entc/integration/cascadelete/ent/post_update.go +++ b/entc/integration/cascadelete/ent/post_update.go @@ -291,7 +291,7 @@ func (pu *PostUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{post.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -597,7 +597,7 @@ func (puo *PostUpdateOne) sqlSave(ctx context.Context) (_node *Post, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{post.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/cascadelete/ent/user_create.go b/entc/integration/cascadelete/ent/user_create.go index b5788e6a5..af0aa2c29 100644 --- a/entc/integration/cascadelete/ent/user_create.go +++ b/entc/integration/cascadelete/ent/user_create.go @@ -148,7 +148,7 @@ func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { _node, _spec := uc.createSpec() if err := sqlgraph.CreateNode(ctx, uc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -231,7 +231,7 @@ func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ucb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/cascadelete/ent/user_update.go b/entc/integration/cascadelete/ent/user_update.go index 325d74ebd..5b505e8ba 100644 --- a/entc/integration/cascadelete/ent/user_update.go +++ b/entc/integration/cascadelete/ent/user_update.go @@ -224,7 +224,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -464,7 +464,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/config/ent/user_create.go b/entc/integration/config/ent/user_create.go index a151fc6b4..a31165c37 100644 --- a/entc/integration/config/ent/user_create.go +++ b/entc/integration/config/ent/user_create.go @@ -139,7 +139,7 @@ func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { _node, _spec := uc.createSpec() if err := sqlgraph.CreateNode(ctx, uc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -216,7 +216,7 @@ func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ucb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/config/ent/user_update.go b/entc/integration/config/ent/user_update.go index 057452d97..ee965d268 100644 --- a/entc/integration/config/ent/user_update.go +++ b/entc/integration/config/ent/user_update.go @@ -178,7 +178,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -373,7 +373,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/customid/ent/account_create.go b/entc/integration/customid/ent/account_create.go index 110b550f2..775050e93 100644 --- a/entc/integration/customid/ent/account_create.go +++ b/entc/integration/customid/ent/account_create.go @@ -163,7 +163,7 @@ func (ac *AccountCreate) sqlSave(ctx context.Context) (*Account, error) { _node, _spec := ac.createSpec() if err := sqlgraph.CreateNode(ctx, ac.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -423,7 +423,7 @@ func (acb *AccountCreateBulk) Save(ctx context.Context) ([]*Account, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, acb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/customid/ent/account_update.go b/entc/integration/customid/ent/account_update.go index b039d8f34..be5f83a39 100644 --- a/entc/integration/customid/ent/account_update.go +++ b/entc/integration/customid/ent/account_update.go @@ -233,7 +233,7 @@ func (au *AccountUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{account.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -481,7 +481,7 @@ func (auo *AccountUpdateOne) sqlSave(ctx context.Context) (_node *Account, err e if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{account.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/customid/ent/blob_create.go b/entc/integration/customid/ent/blob_create.go index 78db68d5f..166bb810b 100644 --- a/entc/integration/customid/ent/blob_create.go +++ b/entc/integration/customid/ent/blob_create.go @@ -209,7 +209,7 @@ func (bc *BlobCreate) sqlSave(ctx context.Context) (*Blob, error) { _node, _spec := bc.createSpec() if err := sqlgraph.CreateNode(ctx, bc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -536,7 +536,7 @@ func (bcb *BlobCreateBulk) Save(ctx context.Context) ([]*Blob, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, bcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/customid/ent/blob_update.go b/entc/integration/customid/ent/blob_update.go index 5192baaed..cf3cdff7a 100644 --- a/entc/integration/customid/ent/blob_update.go +++ b/entc/integration/customid/ent/blob_update.go @@ -319,7 +319,7 @@ func (bu *BlobUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{blob.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -654,7 +654,7 @@ func (buo *BlobUpdateOne) sqlSave(ctx context.Context) (_node *Blob, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{blob.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/customid/ent/car_create.go b/entc/integration/customid/ent/car_create.go index adaaeb40c..c8c5776b3 100644 --- a/entc/integration/customid/ent/car_create.go +++ b/entc/integration/customid/ent/car_create.go @@ -186,7 +186,7 @@ func (cc *CarCreate) sqlSave(ctx context.Context) (*Car, error) { _node, _spec := cc.createSpec() if err := sqlgraph.CreateNode(ctx, cc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -558,7 +558,7 @@ func (ccb *CarCreateBulk) Save(ctx context.Context) ([]*Car, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ccb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/customid/ent/car_update.go b/entc/integration/customid/ent/car_update.go index a06d4294a..c23aaa715 100644 --- a/entc/integration/customid/ent/car_update.go +++ b/entc/integration/customid/ent/car_update.go @@ -301,7 +301,7 @@ func (cu *CarUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{car.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -618,7 +618,7 @@ func (cuo *CarUpdateOne) sqlSave(ctx context.Context) (_node *Car, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{car.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/customid/ent/device_create.go b/entc/integration/customid/ent/device_create.go index 300265c39..64b6289fa 100644 --- a/entc/integration/customid/ent/device_create.go +++ b/entc/integration/customid/ent/device_create.go @@ -173,7 +173,7 @@ func (dc *DeviceCreate) sqlSave(ctx context.Context) (*Device, error) { _node, _spec := dc.createSpec() if err := sqlgraph.CreateNode(ctx, dc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -413,7 +413,7 @@ func (dcb *DeviceCreateBulk) Save(ctx context.Context) ([]*Device, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, dcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/customid/ent/device_update.go b/entc/integration/customid/ent/device_update.go index 55ea7ba1f..2619c760c 100644 --- a/entc/integration/customid/ent/device_update.go +++ b/entc/integration/customid/ent/device_update.go @@ -264,7 +264,7 @@ func (du *DeviceUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{device.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -543,7 +543,7 @@ func (duo *DeviceUpdateOne) sqlSave(ctx context.Context) (_node *Device, err err if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{device.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/customid/ent/doc_create.go b/entc/integration/customid/ent/doc_create.go index 5b0ae3c54..89dc570bf 100644 --- a/entc/integration/customid/ent/doc_create.go +++ b/entc/integration/customid/ent/doc_create.go @@ -186,7 +186,7 @@ func (dc *DocCreate) sqlSave(ctx context.Context) (*Doc, error) { _node, _spec := dc.createSpec() if err := sqlgraph.CreateNode(ctx, dc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -479,7 +479,7 @@ func (dcb *DocCreateBulk) Save(ctx context.Context) ([]*Doc, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, dcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/customid/ent/doc_update.go b/entc/integration/customid/ent/doc_update.go index 078595026..16589a318 100644 --- a/entc/integration/customid/ent/doc_update.go +++ b/entc/integration/customid/ent/doc_update.go @@ -296,7 +296,7 @@ func (du *DocUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{doc.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -608,7 +608,7 @@ func (duo *DocUpdateOne) sqlSave(ctx context.Context) (_node *Doc, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{doc.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/customid/ent/entql.go b/entc/integration/customid/ent/entql.go index 1a7688df5..b3e79c74f 100644 --- a/entc/integration/customid/ent/entql.go +++ b/entc/integration/customid/ent/entql.go @@ -486,7 +486,7 @@ func (aq *AccountQuery) addPredicate(pred func(s *sql.Selector)) { // Filter returns a Filter implementation to apply filters on the AccountQuery builder. func (aq *AccountQuery) Filter() *AccountFilter { - return &AccountFilter{aq.config, aq} + return &AccountFilter{config: aq.config, predicateAdder: aq} } // addPredicate implements the predicateAdder interface. @@ -496,13 +496,13 @@ func (m *AccountMutation) addPredicate(pred func(s *sql.Selector)) { // Filter returns an entql.Where implementation to apply filters on the AccountMutation builder. func (m *AccountMutation) Filter() *AccountFilter { - return &AccountFilter{m.config, m} + return &AccountFilter{config: m.config, predicateAdder: m} } // AccountFilter provides a generic filtering capability at runtime for AccountQuery. type AccountFilter struct { - config predicateAdder + config } // Where applies the entql predicate on the query filter. @@ -545,7 +545,7 @@ func (bq *BlobQuery) addPredicate(pred func(s *sql.Selector)) { // Filter returns a Filter implementation to apply filters on the BlobQuery builder. func (bq *BlobQuery) Filter() *BlobFilter { - return &BlobFilter{bq.config, bq} + return &BlobFilter{config: bq.config, predicateAdder: bq} } // addPredicate implements the predicateAdder interface. @@ -555,13 +555,13 @@ func (m *BlobMutation) addPredicate(pred func(s *sql.Selector)) { // Filter returns an entql.Where implementation to apply filters on the BlobMutation builder. func (m *BlobMutation) Filter() *BlobFilter { - return &BlobFilter{m.config, m} + return &BlobFilter{config: m.config, predicateAdder: m} } // BlobFilter provides a generic filtering capability at runtime for BlobQuery. type BlobFilter struct { - config predicateAdder + config } // Where applies the entql predicate on the query filter. @@ -623,7 +623,7 @@ func (cq *CarQuery) addPredicate(pred func(s *sql.Selector)) { // Filter returns a Filter implementation to apply filters on the CarQuery builder. func (cq *CarQuery) Filter() *CarFilter { - return &CarFilter{cq.config, cq} + return &CarFilter{config: cq.config, predicateAdder: cq} } // addPredicate implements the predicateAdder interface. @@ -633,13 +633,13 @@ func (m *CarMutation) addPredicate(pred func(s *sql.Selector)) { // Filter returns an entql.Where implementation to apply filters on the CarMutation builder. func (m *CarMutation) Filter() *CarFilter { - return &CarFilter{m.config, m} + return &CarFilter{config: m.config, predicateAdder: m} } // CarFilter provides a generic filtering capability at runtime for CarQuery. type CarFilter struct { - config predicateAdder + config } // Where applies the entql predicate on the query filter. @@ -692,7 +692,7 @@ func (dq *DeviceQuery) addPredicate(pred func(s *sql.Selector)) { // Filter returns a Filter implementation to apply filters on the DeviceQuery builder. func (dq *DeviceQuery) Filter() *DeviceFilter { - return &DeviceFilter{dq.config, dq} + return &DeviceFilter{config: dq.config, predicateAdder: dq} } // addPredicate implements the predicateAdder interface. @@ -702,13 +702,13 @@ func (m *DeviceMutation) addPredicate(pred func(s *sql.Selector)) { // Filter returns an entql.Where implementation to apply filters on the DeviceMutation builder. func (m *DeviceMutation) Filter() *DeviceFilter { - return &DeviceFilter{m.config, m} + return &DeviceFilter{config: m.config, predicateAdder: m} } // DeviceFilter provides a generic filtering capability at runtime for DeviceQuery. type DeviceFilter struct { - config predicateAdder + config } // Where applies the entql predicate on the query filter. @@ -760,7 +760,7 @@ func (dq *DocQuery) addPredicate(pred func(s *sql.Selector)) { // Filter returns a Filter implementation to apply filters on the DocQuery builder. func (dq *DocQuery) Filter() *DocFilter { - return &DocFilter{dq.config, dq} + return &DocFilter{config: dq.config, predicateAdder: dq} } // addPredicate implements the predicateAdder interface. @@ -770,13 +770,13 @@ func (m *DocMutation) addPredicate(pred func(s *sql.Selector)) { // Filter returns an entql.Where implementation to apply filters on the DocMutation builder. func (m *DocMutation) Filter() *DocFilter { - return &DocFilter{m.config, m} + return &DocFilter{config: m.config, predicateAdder: m} } // DocFilter provides a generic filtering capability at runtime for DocQuery. type DocFilter struct { - config predicateAdder + config } // Where applies the entql predicate on the query filter. @@ -833,7 +833,7 @@ func (gq *GroupQuery) addPredicate(pred func(s *sql.Selector)) { // Filter returns a Filter implementation to apply filters on the GroupQuery builder. func (gq *GroupQuery) Filter() *GroupFilter { - return &GroupFilter{gq.config, gq} + return &GroupFilter{config: gq.config, predicateAdder: gq} } // addPredicate implements the predicateAdder interface. @@ -843,13 +843,13 @@ func (m *GroupMutation) addPredicate(pred func(s *sql.Selector)) { // Filter returns an entql.Where implementation to apply filters on the GroupMutation builder. func (m *GroupMutation) Filter() *GroupFilter { - return &GroupFilter{m.config, m} + return &GroupFilter{config: m.config, predicateAdder: m} } // GroupFilter provides a generic filtering capability at runtime for GroupQuery. type GroupFilter struct { - config predicateAdder + config } // Where applies the entql predicate on the query filter. @@ -887,7 +887,7 @@ func (miq *MixinIDQuery) addPredicate(pred func(s *sql.Selector)) { // Filter returns a Filter implementation to apply filters on the MixinIDQuery builder. func (miq *MixinIDQuery) Filter() *MixinIDFilter { - return &MixinIDFilter{miq.config, miq} + return &MixinIDFilter{config: miq.config, predicateAdder: miq} } // addPredicate implements the predicateAdder interface. @@ -897,13 +897,13 @@ func (m *MixinIDMutation) addPredicate(pred func(s *sql.Selector)) { // Filter returns an entql.Where implementation to apply filters on the MixinIDMutation builder. func (m *MixinIDMutation) Filter() *MixinIDFilter { - return &MixinIDFilter{m.config, m} + return &MixinIDFilter{config: m.config, predicateAdder: m} } // MixinIDFilter provides a generic filtering capability at runtime for MixinIDQuery. type MixinIDFilter struct { - config predicateAdder + config } // Where applies the entql predicate on the query filter. @@ -937,7 +937,7 @@ func (nq *NoteQuery) addPredicate(pred func(s *sql.Selector)) { // Filter returns a Filter implementation to apply filters on the NoteQuery builder. func (nq *NoteQuery) Filter() *NoteFilter { - return &NoteFilter{nq.config, nq} + return &NoteFilter{config: nq.config, predicateAdder: nq} } // addPredicate implements the predicateAdder interface. @@ -947,13 +947,13 @@ func (m *NoteMutation) addPredicate(pred func(s *sql.Selector)) { // Filter returns an entql.Where implementation to apply filters on the NoteMutation builder. func (m *NoteMutation) Filter() *NoteFilter { - return &NoteFilter{m.config, m} + return &NoteFilter{config: m.config, predicateAdder: m} } // NoteFilter provides a generic filtering capability at runtime for NoteQuery. type NoteFilter struct { - config predicateAdder + config } // Where applies the entql predicate on the query filter. @@ -1010,7 +1010,7 @@ func (oq *OtherQuery) addPredicate(pred func(s *sql.Selector)) { // Filter returns a Filter implementation to apply filters on the OtherQuery builder. func (oq *OtherQuery) Filter() *OtherFilter { - return &OtherFilter{oq.config, oq} + return &OtherFilter{config: oq.config, predicateAdder: oq} } // addPredicate implements the predicateAdder interface. @@ -1020,13 +1020,13 @@ func (m *OtherMutation) addPredicate(pred func(s *sql.Selector)) { // Filter returns an entql.Where implementation to apply filters on the OtherMutation builder. func (m *OtherMutation) Filter() *OtherFilter { - return &OtherFilter{m.config, m} + return &OtherFilter{config: m.config, predicateAdder: m} } // OtherFilter provides a generic filtering capability at runtime for OtherQuery. type OtherFilter struct { - config predicateAdder + config } // Where applies the entql predicate on the query filter. @@ -1050,7 +1050,7 @@ func (pq *PetQuery) addPredicate(pred func(s *sql.Selector)) { // Filter returns a Filter implementation to apply filters on the PetQuery builder. func (pq *PetQuery) Filter() *PetFilter { - return &PetFilter{pq.config, pq} + return &PetFilter{config: pq.config, predicateAdder: pq} } // addPredicate implements the predicateAdder interface. @@ -1060,13 +1060,13 @@ func (m *PetMutation) addPredicate(pred func(s *sql.Selector)) { // Filter returns an entql.Where implementation to apply filters on the PetMutation builder. func (m *PetMutation) Filter() *PetFilter { - return &PetFilter{m.config, m} + return &PetFilter{config: m.config, predicateAdder: m} } // PetFilter provides a generic filtering capability at runtime for PetQuery. type PetFilter struct { - config predicateAdder + config } // Where applies the entql predicate on the query filter. @@ -1146,7 +1146,7 @@ func (rq *RevisionQuery) addPredicate(pred func(s *sql.Selector)) { // Filter returns a Filter implementation to apply filters on the RevisionQuery builder. func (rq *RevisionQuery) Filter() *RevisionFilter { - return &RevisionFilter{rq.config, rq} + return &RevisionFilter{config: rq.config, predicateAdder: rq} } // addPredicate implements the predicateAdder interface. @@ -1156,13 +1156,13 @@ func (m *RevisionMutation) addPredicate(pred func(s *sql.Selector)) { // Filter returns an entql.Where implementation to apply filters on the RevisionMutation builder. func (m *RevisionMutation) Filter() *RevisionFilter { - return &RevisionFilter{m.config, m} + return &RevisionFilter{config: m.config, predicateAdder: m} } // RevisionFilter provides a generic filtering capability at runtime for RevisionQuery. type RevisionFilter struct { - config predicateAdder + config } // Where applies the entql predicate on the query filter. @@ -1186,7 +1186,7 @@ func (sq *SessionQuery) addPredicate(pred func(s *sql.Selector)) { // Filter returns a Filter implementation to apply filters on the SessionQuery builder. func (sq *SessionQuery) Filter() *SessionFilter { - return &SessionFilter{sq.config, sq} + return &SessionFilter{config: sq.config, predicateAdder: sq} } // addPredicate implements the predicateAdder interface. @@ -1196,13 +1196,13 @@ func (m *SessionMutation) addPredicate(pred func(s *sql.Selector)) { // Filter returns an entql.Where implementation to apply filters on the SessionMutation builder. func (m *SessionMutation) Filter() *SessionFilter { - return &SessionFilter{m.config, m} + return &SessionFilter{config: m.config, predicateAdder: m} } // SessionFilter provides a generic filtering capability at runtime for SessionQuery. type SessionFilter struct { - config predicateAdder + config } // Where applies the entql predicate on the query filter. @@ -1240,7 +1240,7 @@ func (tq *TokenQuery) addPredicate(pred func(s *sql.Selector)) { // Filter returns a Filter implementation to apply filters on the TokenQuery builder. func (tq *TokenQuery) Filter() *TokenFilter { - return &TokenFilter{tq.config, tq} + return &TokenFilter{config: tq.config, predicateAdder: tq} } // addPredicate implements the predicateAdder interface. @@ -1250,13 +1250,13 @@ func (m *TokenMutation) addPredicate(pred func(s *sql.Selector)) { // Filter returns an entql.Where implementation to apply filters on the TokenMutation builder. func (m *TokenMutation) Filter() *TokenFilter { - return &TokenFilter{m.config, m} + return &TokenFilter{config: m.config, predicateAdder: m} } // TokenFilter provides a generic filtering capability at runtime for TokenQuery. type TokenFilter struct { - config predicateAdder + config } // Where applies the entql predicate on the query filter. @@ -1299,7 +1299,7 @@ func (uq *UserQuery) addPredicate(pred func(s *sql.Selector)) { // Filter returns a Filter implementation to apply filters on the UserQuery builder. func (uq *UserQuery) Filter() *UserFilter { - return &UserFilter{uq.config, uq} + return &UserFilter{config: uq.config, predicateAdder: uq} } // addPredicate implements the predicateAdder interface. @@ -1309,13 +1309,13 @@ func (m *UserMutation) addPredicate(pred func(s *sql.Selector)) { // Filter returns an entql.Where implementation to apply filters on the UserMutation builder. func (m *UserMutation) Filter() *UserFilter { - return &UserFilter{m.config, m} + return &UserFilter{config: m.config, predicateAdder: m} } // UserFilter provides a generic filtering capability at runtime for UserQuery. type UserFilter struct { - config predicateAdder + config } // Where applies the entql predicate on the query filter. diff --git a/entc/integration/customid/ent/group_create.go b/entc/integration/customid/ent/group_create.go index 370f0b63c..1a4bbc41a 100644 --- a/entc/integration/customid/ent/group_create.go +++ b/entc/integration/customid/ent/group_create.go @@ -130,7 +130,7 @@ func (gc *GroupCreate) sqlSave(ctx context.Context) (*Group, error) { _node, _spec := gc.createSpec() if err := sqlgraph.CreateNode(ctx, gc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -341,7 +341,7 @@ func (gcb *GroupCreateBulk) Save(ctx context.Context) ([]*Group, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, gcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/customid/ent/group_update.go b/entc/integration/customid/ent/group_update.go index 333ed0461..23d37bed4 100644 --- a/entc/integration/customid/ent/group_update.go +++ b/entc/integration/customid/ent/group_update.go @@ -203,7 +203,7 @@ func (gu *GroupUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{group.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -422,7 +422,7 @@ func (guo *GroupUpdateOne) sqlSave(ctx context.Context) (_node *Group, err error if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{group.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/customid/ent/mixinid_create.go b/entc/integration/customid/ent/mixinid_create.go index 10cb5c955..98d926b26 100644 --- a/entc/integration/customid/ent/mixinid_create.go +++ b/entc/integration/customid/ent/mixinid_create.go @@ -151,7 +151,7 @@ func (mic *MixinIDCreate) sqlSave(ctx context.Context) (*MixinID, error) { _node, _spec := mic.createSpec() if err := sqlgraph.CreateNode(ctx, mic.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -426,7 +426,7 @@ func (micb *MixinIDCreateBulk) Save(ctx context.Context) ([]*MixinID, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, micb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/customid/ent/mixinid_update.go b/entc/integration/customid/ent/mixinid_update.go index 9ed305611..978a5b2b0 100644 --- a/entc/integration/customid/ent/mixinid_update.go +++ b/entc/integration/customid/ent/mixinid_update.go @@ -138,7 +138,7 @@ func (miu *MixinIDUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{mixinid.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -293,7 +293,7 @@ func (miuo *MixinIDUpdateOne) sqlSave(ctx context.Context) (_node *MixinID, err if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{mixinid.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/customid/ent/note_create.go b/entc/integration/customid/ent/note_create.go index f51900369..8091c249f 100644 --- a/entc/integration/customid/ent/note_create.go +++ b/entc/integration/customid/ent/note_create.go @@ -186,7 +186,7 @@ func (nc *NoteCreate) sqlSave(ctx context.Context) (*Note, error) { _node, _spec := nc.createSpec() if err := sqlgraph.CreateNode(ctx, nc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -479,7 +479,7 @@ func (ncb *NoteCreateBulk) Save(ctx context.Context) ([]*Note, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ncb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/customid/ent/note_update.go b/entc/integration/customid/ent/note_update.go index 4b2290334..33c819f37 100644 --- a/entc/integration/customid/ent/note_update.go +++ b/entc/integration/customid/ent/note_update.go @@ -296,7 +296,7 @@ func (nu *NoteUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{note.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -608,7 +608,7 @@ func (nuo *NoteUpdateOne) sqlSave(ctx context.Context) (_node *Note, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{note.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/customid/ent/other_create.go b/entc/integration/customid/ent/other_create.go index 442ebe83a..4dca1a7d7 100644 --- a/entc/integration/customid/ent/other_create.go +++ b/entc/integration/customid/ent/other_create.go @@ -133,7 +133,7 @@ func (oc *OtherCreate) sqlSave(ctx context.Context) (*Other, error) { _node, _spec := oc.createSpec() if err := sqlgraph.CreateNode(ctx, oc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -334,7 +334,7 @@ func (ocb *OtherCreateBulk) Save(ctx context.Context) ([]*Other, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ocb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/customid/ent/other_update.go b/entc/integration/customid/ent/other_update.go index 2f8d41321..fdc0ad0b0 100644 --- a/entc/integration/customid/ent/other_update.go +++ b/entc/integration/customid/ent/other_update.go @@ -112,7 +112,7 @@ func (ou *OtherUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{other.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -241,7 +241,7 @@ func (ouo *OtherUpdateOne) sqlSave(ctx context.Context) (_node *Other, err error if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{other.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/customid/ent/pet_create.go b/entc/integration/customid/ent/pet_create.go index dbb1922b2..6c97167cb 100644 --- a/entc/integration/customid/ent/pet_create.go +++ b/entc/integration/customid/ent/pet_create.go @@ -207,7 +207,7 @@ func (pc *PetCreate) sqlSave(ctx context.Context) (*Pet, error) { _node, _spec := pc.createSpec() if err := sqlgraph.CreateNode(ctx, pc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -486,7 +486,7 @@ func (pcb *PetCreateBulk) Save(ctx context.Context) ([]*Pet, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, pcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/customid/ent/pet_update.go b/entc/integration/customid/ent/pet_update.go index f4d9038ca..4bb250e06 100644 --- a/entc/integration/customid/ent/pet_update.go +++ b/entc/integration/customid/ent/pet_update.go @@ -414,7 +414,7 @@ func (pu *PetUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{pet.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -843,7 +843,7 @@ func (puo *PetUpdateOne) sqlSave(ctx context.Context) (_node *Pet, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{pet.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/customid/ent/revision_create.go b/entc/integration/customid/ent/revision_create.go index e05c33fb3..65cc4e37e 100644 --- a/entc/integration/customid/ent/revision_create.go +++ b/entc/integration/customid/ent/revision_create.go @@ -115,7 +115,7 @@ func (rc *RevisionCreate) sqlSave(ctx context.Context) (*Revision, error) { _node, _spec := rc.createSpec() if err := sqlgraph.CreateNode(ctx, rc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -315,7 +315,7 @@ func (rcb *RevisionCreateBulk) Save(ctx context.Context) ([]*Revision, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, rcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/customid/ent/revision_update.go b/entc/integration/customid/ent/revision_update.go index ab6e6271e..1968393a0 100644 --- a/entc/integration/customid/ent/revision_update.go +++ b/entc/integration/customid/ent/revision_update.go @@ -112,7 +112,7 @@ func (ru *RevisionUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{revision.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -241,7 +241,7 @@ func (ruo *RevisionUpdateOne) sqlSave(ctx context.Context) (_node *Revision, err if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{revision.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/customid/ent/session_create.go b/entc/integration/customid/ent/session_create.go index ba48cf50a..b276e12a4 100644 --- a/entc/integration/customid/ent/session_create.go +++ b/entc/integration/customid/ent/session_create.go @@ -158,7 +158,7 @@ func (sc *SessionCreate) sqlSave(ctx context.Context) (*Session, error) { _node, _spec := sc.createSpec() if err := sqlgraph.CreateNode(ctx, sc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -379,7 +379,7 @@ func (scb *SessionCreateBulk) Save(ctx context.Context) ([]*Session, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, scb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/customid/ent/session_update.go b/entc/integration/customid/ent/session_update.go index 5568f6ef8..741c77125 100644 --- a/entc/integration/customid/ent/session_update.go +++ b/entc/integration/customid/ent/session_update.go @@ -174,7 +174,7 @@ func (su *SessionUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{session.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -363,7 +363,7 @@ func (suo *SessionUpdateOne) sqlSave(ctx context.Context) (_node *Session, err e if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{session.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/customid/ent/token_create.go b/entc/integration/customid/ent/token_create.go index 4f6c62dc3..2fc2b14b4 100644 --- a/entc/integration/customid/ent/token_create.go +++ b/entc/integration/customid/ent/token_create.go @@ -162,7 +162,7 @@ func (tc *TokenCreate) sqlSave(ctx context.Context) (*Token, error) { _node, _spec := tc.createSpec() if err := sqlgraph.CreateNode(ctx, tc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -423,7 +423,7 @@ func (tcb *TokenCreateBulk) Save(ctx context.Context) ([]*Token, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, tcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/customid/ent/token_update.go b/entc/integration/customid/ent/token_update.go index 36a61aa94..95287fe55 100644 --- a/entc/integration/customid/ent/token_update.go +++ b/entc/integration/customid/ent/token_update.go @@ -198,7 +198,7 @@ func (tu *TokenUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{token.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -411,7 +411,7 @@ func (tuo *TokenUpdateOne) sqlSave(ctx context.Context) (_node *Token, err error if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{token.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/customid/ent/user_create.go b/entc/integration/customid/ent/user_create.go index 1accca4be..2d04143f1 100644 --- a/entc/integration/customid/ent/user_create.go +++ b/entc/integration/customid/ent/user_create.go @@ -180,7 +180,7 @@ func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { _node, _spec := uc.createSpec() if err := sqlgraph.CreateNode(ctx, uc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -449,7 +449,7 @@ func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ucb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/customid/ent/user_update.go b/entc/integration/customid/ent/user_update.go index d26e7f0e4..2ec1687c7 100644 --- a/entc/integration/customid/ent/user_update.go +++ b/entc/integration/customid/ent/user_update.go @@ -444,7 +444,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -903,7 +903,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/edgefield/ent/car_create.go b/entc/integration/edgefield/ent/car_create.go index 5ff3665cc..dc9743ebe 100644 --- a/entc/integration/edgefield/ent/car_create.go +++ b/entc/integration/edgefield/ent/car_create.go @@ -159,7 +159,7 @@ func (cc *CarCreate) sqlSave(ctx context.Context) (*Car, error) { _node, _spec := cc.createSpec() if err := sqlgraph.CreateNode(ctx, cc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -251,7 +251,7 @@ func (ccb *CarCreateBulk) Save(ctx context.Context) ([]*Car, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ccb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/edgefield/ent/car_update.go b/entc/integration/edgefield/ent/car_update.go index 95a0f8a8b..0697ab715 100644 --- a/entc/integration/edgefield/ent/car_update.go +++ b/entc/integration/edgefield/ent/car_update.go @@ -236,7 +236,7 @@ func (cu *CarUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{car.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -488,7 +488,7 @@ func (cuo *CarUpdateOne) sqlSave(ctx context.Context) (_node *Car, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{car.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/edgefield/ent/card_create.go b/entc/integration/edgefield/ent/card_create.go index 27aa909dc..9ae166795 100644 --- a/entc/integration/edgefield/ent/card_create.go +++ b/entc/integration/edgefield/ent/card_create.go @@ -139,7 +139,7 @@ func (cc *CardCreate) sqlSave(ctx context.Context) (*Card, error) { _node, _spec := cc.createSpec() if err := sqlgraph.CreateNode(ctx, cc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -222,7 +222,7 @@ func (ccb *CardCreateBulk) Save(ctx context.Context) ([]*Card, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ccb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/edgefield/ent/card_update.go b/entc/integration/edgefield/ent/card_update.go index 9bfae5ba9..ae4f11044 100644 --- a/entc/integration/edgefield/ent/card_update.go +++ b/entc/integration/edgefield/ent/card_update.go @@ -212,7 +212,7 @@ func (cu *CardUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{card.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -440,7 +440,7 @@ func (cuo *CardUpdateOne) sqlSave(ctx context.Context) (_node *Card, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{card.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/edgefield/ent/info_create.go b/entc/integration/edgefield/ent/info_create.go index cc5c3523e..5df3bcd8b 100644 --- a/entc/integration/edgefield/ent/info_create.go +++ b/entc/integration/edgefield/ent/info_create.go @@ -142,7 +142,7 @@ func (ic *InfoCreate) sqlSave(ctx context.Context) (*Info, error) { _node, _spec := ic.createSpec() if err := sqlgraph.CreateNode(ctx, ic.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -231,7 +231,7 @@ func (icb *InfoCreateBulk) Save(ctx context.Context) ([]*Info, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, icb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/edgefield/ent/info_update.go b/entc/integration/edgefield/ent/info_update.go index 37180cfc3..fb6ca67a3 100644 --- a/entc/integration/edgefield/ent/info_update.go +++ b/entc/integration/edgefield/ent/info_update.go @@ -187,7 +187,7 @@ func (iu *InfoUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{info.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -389,7 +389,7 @@ func (iuo *InfoUpdateOne) sqlSave(ctx context.Context) (_node *Info, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{info.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/edgefield/ent/metadata_create.go b/entc/integration/edgefield/ent/metadata_create.go index 22c74a302..442ec54fa 100644 --- a/entc/integration/edgefield/ent/metadata_create.go +++ b/entc/integration/edgefield/ent/metadata_create.go @@ -192,7 +192,7 @@ func (mc *MetadataCreate) sqlSave(ctx context.Context) (*Metadata, error) { _node, _spec := mc.createSpec() if err := sqlgraph.CreateNode(ctx, mc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -321,7 +321,7 @@ func (mcb *MetadataCreateBulk) Save(ctx context.Context) ([]*Metadata, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, mcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/edgefield/ent/metadata_update.go b/entc/integration/edgefield/ent/metadata_update.go index bc284abb5..bab23c1f0 100644 --- a/entc/integration/edgefield/ent/metadata_update.go +++ b/entc/integration/edgefield/ent/metadata_update.go @@ -364,7 +364,7 @@ func (mu *MetadataUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{metadata.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -744,7 +744,7 @@ func (muo *MetadataUpdateOne) sqlSave(ctx context.Context) (_node *Metadata, err if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{metadata.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/edgefield/ent/node_create.go b/entc/integration/edgefield/ent/node_create.go index c8be3de16..3b2e1a031 100644 --- a/entc/integration/edgefield/ent/node_create.go +++ b/entc/integration/edgefield/ent/node_create.go @@ -170,7 +170,7 @@ func (nc *NodeCreate) sqlSave(ctx context.Context) (*Node, error) { _node, _spec := nc.createSpec() if err := sqlgraph.CreateNode(ctx, nc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -273,7 +273,7 @@ func (ncb *NodeCreateBulk) Save(ctx context.Context) ([]*Node, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ncb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/edgefield/ent/node_update.go b/entc/integration/edgefield/ent/node_update.go index 363eb4f2f..c36ef82af 100644 --- a/entc/integration/edgefield/ent/node_update.go +++ b/entc/integration/edgefield/ent/node_update.go @@ -273,7 +273,7 @@ func (nu *NodeUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{node.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -563,7 +563,7 @@ func (nuo *NodeUpdateOne) sqlSave(ctx context.Context) (_node *Node, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{node.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/edgefield/ent/pet_create.go b/entc/integration/edgefield/ent/pet_create.go index 5ed63470a..246bf5aa1 100644 --- a/entc/integration/edgefield/ent/pet_create.go +++ b/entc/integration/edgefield/ent/pet_create.go @@ -125,7 +125,7 @@ func (pc *PetCreate) sqlSave(ctx context.Context) (*Pet, error) { _node, _spec := pc.createSpec() if err := sqlgraph.CreateNode(ctx, pc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -200,7 +200,7 @@ func (pcb *PetCreateBulk) Save(ctx context.Context) ([]*Pet, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, pcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/edgefield/ent/pet_update.go b/entc/integration/edgefield/ent/pet_update.go index 3f3138dfa..d04ad1161 100644 --- a/entc/integration/edgefield/ent/pet_update.go +++ b/entc/integration/edgefield/ent/pet_update.go @@ -179,7 +179,7 @@ func (pu *PetUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{pet.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -374,7 +374,7 @@ func (puo *PetUpdateOne) sqlSave(ctx context.Context) (_node *Pet, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{pet.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/edgefield/ent/post_create.go b/entc/integration/edgefield/ent/post_create.go index 85f5c0094..3e7aa06c8 100644 --- a/entc/integration/edgefield/ent/post_create.go +++ b/entc/integration/edgefield/ent/post_create.go @@ -135,7 +135,7 @@ func (pc *PostCreate) sqlSave(ctx context.Context) (*Post, error) { _node, _spec := pc.createSpec() if err := sqlgraph.CreateNode(ctx, pc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -218,7 +218,7 @@ func (pcb *PostCreateBulk) Save(ctx context.Context) ([]*Post, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, pcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/edgefield/ent/post_update.go b/entc/integration/edgefield/ent/post_update.go index df8d3a3fb..9fc293d0a 100644 --- a/entc/integration/edgefield/ent/post_update.go +++ b/entc/integration/edgefield/ent/post_update.go @@ -192,7 +192,7 @@ func (pu *PostUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{post.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -400,7 +400,7 @@ func (puo *PostUpdateOne) sqlSave(ctx context.Context) (_node *Post, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{post.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/edgefield/ent/rental_create.go b/entc/integration/edgefield/ent/rental_create.go index ca8b4dc02..bb778ea47 100644 --- a/entc/integration/edgefield/ent/rental_create.go +++ b/entc/integration/edgefield/ent/rental_create.go @@ -170,7 +170,7 @@ func (rc *RentalCreate) sqlSave(ctx context.Context) (*Rental, error) { _node, _spec := rc.createSpec() if err := sqlgraph.CreateNode(ctx, rc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -274,7 +274,7 @@ func (rcb *RentalCreateBulk) Save(ctx context.Context) ([]*Rental, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, rcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/edgefield/ent/rental_update.go b/entc/integration/edgefield/ent/rental_update.go index 1e94f99ca..5cd675b24 100644 --- a/entc/integration/edgefield/ent/rental_update.go +++ b/entc/integration/edgefield/ent/rental_update.go @@ -258,7 +258,7 @@ func (ru *RentalUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{rental.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -529,7 +529,7 @@ func (ruo *RentalUpdateOne) sqlSave(ctx context.Context) (_node *Rental, err err if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{rental.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/edgefield/ent/user_create.go b/entc/integration/edgefield/ent/user_create.go index c5bd0fa27..a0db19dbd 100644 --- a/entc/integration/edgefield/ent/user_create.go +++ b/entc/integration/edgefield/ent/user_create.go @@ -252,7 +252,7 @@ func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { _node, _spec := uc.createSpec() if err := sqlgraph.CreateNode(ctx, uc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -467,7 +467,7 @@ func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ucb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/edgefield/ent/user_update.go b/entc/integration/edgefield/ent/user_update.go index d7efe43ea..e0e977207 100644 --- a/entc/integration/edgefield/ent/user_update.go +++ b/entc/integration/edgefield/ent/user_update.go @@ -729,7 +729,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -1470,7 +1470,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/edgeschema/ent/friendship_create.go b/entc/integration/edgeschema/ent/friendship_create.go index 5d04d4e56..5604c12eb 100644 --- a/entc/integration/edgeschema/ent/friendship_create.go +++ b/entc/integration/edgeschema/ent/friendship_create.go @@ -185,7 +185,7 @@ func (fc *FriendshipCreate) sqlSave(ctx context.Context) (*Friendship, error) { _node, _spec := fc.createSpec() if err := sqlgraph.CreateNode(ctx, fc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -297,7 +297,7 @@ func (fcb *FriendshipCreateBulk) Save(ctx context.Context) ([]*Friendship, error // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, fcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/edgeschema/ent/friendship_update.go b/entc/integration/edgeschema/ent/friendship_update.go index c3daf27e8..6dbd1d268 100644 --- a/entc/integration/edgeschema/ent/friendship_update.go +++ b/entc/integration/edgeschema/ent/friendship_update.go @@ -287,7 +287,7 @@ func (fu *FriendshipUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{friendship.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -593,7 +593,7 @@ func (fuo *FriendshipUpdateOne) sqlSave(ctx context.Context) (_node *Friendship, if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{friendship.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/edgeschema/ent/group_create.go b/entc/integration/edgeschema/ent/group_create.go index 0aa5c9962..79d7e5f97 100644 --- a/entc/integration/edgeschema/ent/group_create.go +++ b/entc/integration/edgeschema/ent/group_create.go @@ -160,7 +160,7 @@ func (gc *GroupCreate) sqlSave(ctx context.Context) (*Group, error) { _node, _spec := gc.createSpec() if err := sqlgraph.CreateNode(ctx, gc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -266,7 +266,7 @@ func (gcb *GroupCreateBulk) Save(ctx context.Context) ([]*Group, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, gcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/edgeschema/ent/group_update.go b/entc/integration/edgeschema/ent/group_update.go index e68355645..43dc4f69c 100644 --- a/entc/integration/edgeschema/ent/group_update.go +++ b/entc/integration/edgeschema/ent/group_update.go @@ -323,7 +323,7 @@ func (gu *GroupUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{group.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -665,7 +665,7 @@ func (guo *GroupUpdateOne) sqlSave(ctx context.Context) (_node *Group, err error if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{group.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/edgeschema/ent/relationship_create.go b/entc/integration/edgeschema/ent/relationship_create.go index a40a63259..726da07d2 100644 --- a/entc/integration/edgeschema/ent/relationship_create.go +++ b/entc/integration/edgeschema/ent/relationship_create.go @@ -161,7 +161,7 @@ func (rc *RelationshipCreate) sqlSave(ctx context.Context) (*Relationship, error _node, _spec := rc.createSpec() if err := sqlgraph.CreateNode(ctx, rc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -259,7 +259,7 @@ func (rcb *RelationshipCreateBulk) Save(ctx context.Context) ([]*Relationship, e // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, rcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/edgeschema/ent/relationship_update.go b/entc/integration/edgeschema/ent/relationship_update.go index fe2cb97ef..ab9ddc051 100644 --- a/entc/integration/edgeschema/ent/relationship_update.go +++ b/entc/integration/edgeschema/ent/relationship_update.go @@ -261,7 +261,7 @@ func (ru *RelationshipUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{relationship.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -534,7 +534,7 @@ func (ruo *RelationshipUpdateOne) sqlSave(ctx context.Context) (_node *Relations if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{relationship.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/edgeschema/ent/tweet_create.go b/entc/integration/edgeschema/ent/tweet_create.go index da20877bb..14e845422 100644 --- a/entc/integration/edgeschema/ent/tweet_create.go +++ b/entc/integration/edgeschema/ent/tweet_create.go @@ -158,7 +158,7 @@ func (tc *TweetCreate) sqlSave(ctx context.Context) (*Tweet, error) { _node, _spec := tc.createSpec() if err := sqlgraph.CreateNode(ctx, tc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -286,7 +286,7 @@ func (tcb *TweetCreateBulk) Save(ctx context.Context) ([]*Tweet, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, tcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/edgeschema/ent/tweet_update.go b/entc/integration/edgeschema/ent/tweet_update.go index 180805ecd..383bedcdb 100644 --- a/entc/integration/edgeschema/ent/tweet_update.go +++ b/entc/integration/edgeschema/ent/tweet_update.go @@ -417,7 +417,7 @@ func (tu *TweetUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{tweet.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -853,7 +853,7 @@ func (tuo *TweetUpdateOne) sqlSave(ctx context.Context) (_node *Tweet, err error if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{tweet.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/edgeschema/ent/tweetlike_create.go b/entc/integration/edgeschema/ent/tweetlike_create.go index 011de7d6e..0a7310698 100644 --- a/entc/integration/edgeschema/ent/tweetlike_create.go +++ b/entc/integration/edgeschema/ent/tweetlike_create.go @@ -163,7 +163,7 @@ func (tlc *TweetLikeCreate) sqlSave(ctx context.Context) (*TweetLike, error) { _node, _spec := tlc.createSpec() if err := sqlgraph.CreateNode(ctx, tlc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -261,7 +261,7 @@ func (tlcb *TweetLikeCreateBulk) Save(ctx context.Context) ([]*TweetLike, error) // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, tlcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/edgeschema/ent/tweetlike_update.go b/entc/integration/edgeschema/ent/tweetlike_update.go index 492285e3f..3503c7f4a 100644 --- a/entc/integration/edgeschema/ent/tweetlike_update.go +++ b/entc/integration/edgeschema/ent/tweetlike_update.go @@ -249,7 +249,7 @@ func (tlu *TweetLikeUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{tweetlike.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -508,7 +508,7 @@ func (tluo *TweetLikeUpdateOne) sqlSave(ctx context.Context) (_node *TweetLike, if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{tweetlike.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/edgeschema/ent/user_create.go b/entc/integration/edgeschema/ent/user_create.go index acee45073..a83aad9c2 100644 --- a/entc/integration/edgeschema/ent/user_create.go +++ b/entc/integration/edgeschema/ent/user_create.go @@ -253,7 +253,7 @@ func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { _node, _spec := uc.createSpec() if err := sqlgraph.CreateNode(ctx, uc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -489,7 +489,7 @@ func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ucb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/edgeschema/ent/user_update.go b/entc/integration/edgeschema/ent/user_update.go index a9136f44a..ec5c9f426 100644 --- a/entc/integration/edgeschema/ent/user_update.go +++ b/entc/integration/edgeschema/ent/user_update.go @@ -914,7 +914,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -1844,7 +1844,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/edgeschema/ent/usergroup_create.go b/entc/integration/edgeschema/ent/usergroup_create.go index 4926e2226..2d8ef9762 100644 --- a/entc/integration/edgeschema/ent/usergroup_create.go +++ b/entc/integration/edgeschema/ent/usergroup_create.go @@ -165,7 +165,7 @@ func (ugc *UserGroupCreate) sqlSave(ctx context.Context) (*UserGroup, error) { _node, _spec := ugc.createSpec() if err := sqlgraph.CreateNode(ctx, ugc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -269,7 +269,7 @@ func (ugcb *UserGroupCreateBulk) Save(ctx context.Context) ([]*UserGroup, error) // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ugcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/edgeschema/ent/usergroup_update.go b/entc/integration/edgeschema/ent/usergroup_update.go index 9c48cfa29..329ce4f8e 100644 --- a/entc/integration/edgeschema/ent/usergroup_update.go +++ b/entc/integration/edgeschema/ent/usergroup_update.go @@ -253,7 +253,7 @@ func (ugu *UserGroupUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{usergroup.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -524,7 +524,7 @@ func (uguo *UserGroupUpdateOne) sqlSave(ctx context.Context) (_node *UserGroup, if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{usergroup.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/edgeschema/ent/usertweet_create.go b/entc/integration/edgeschema/ent/usertweet_create.go index f61debeef..f9d0bd2a7 100644 --- a/entc/integration/edgeschema/ent/usertweet_create.go +++ b/entc/integration/edgeschema/ent/usertweet_create.go @@ -165,7 +165,7 @@ func (utc *UserTweetCreate) sqlSave(ctx context.Context) (*UserTweet, error) { _node, _spec := utc.createSpec() if err := sqlgraph.CreateNode(ctx, utc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -269,7 +269,7 @@ func (utcb *UserTweetCreateBulk) Save(ctx context.Context) ([]*UserTweet, error) // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, utcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/edgeschema/ent/usertweet_update.go b/entc/integration/edgeschema/ent/usertweet_update.go index 0c0154a63..8c6cefbed 100644 --- a/entc/integration/edgeschema/ent/usertweet_update.go +++ b/entc/integration/edgeschema/ent/usertweet_update.go @@ -253,7 +253,7 @@ func (utu *UserTweetUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{usertweet.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -524,7 +524,7 @@ func (utuo *UserTweetUpdateOne) sqlSave(ctx context.Context) (_node *UserTweet, if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{usertweet.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/ent/card_create.go b/entc/integration/ent/card_create.go index 65df27474..d19783382 100644 --- a/entc/integration/ent/card_create.go +++ b/entc/integration/ent/card_create.go @@ -246,7 +246,7 @@ func (cc *CardCreate) sqlSave(ctx context.Context) (*Card, error) { _node, _spec := cc.createSpec() if err := sqlgraph.CreateNode(ctx, cc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -674,7 +674,7 @@ func (ccb *CardCreateBulk) Save(ctx context.Context) ([]*Card, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ccb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/ent/card_update.go b/entc/integration/ent/card_update.go index feda21fe4..6e76ec984 100644 --- a/entc/integration/ent/card_update.go +++ b/entc/integration/ent/card_update.go @@ -371,7 +371,7 @@ func (cu *CardUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{card.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -756,7 +756,7 @@ func (cuo *CardUpdateOne) sqlSave(ctx context.Context) (_node *Card, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{card.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/ent/comment_create.go b/entc/integration/ent/comment_create.go index a775cd3e1..f9fbaae9e 100644 --- a/entc/integration/ent/comment_create.go +++ b/entc/integration/ent/comment_create.go @@ -154,7 +154,7 @@ func (cc *CommentCreate) sqlSave(ctx context.Context) (*Comment, error) { _node, _spec := cc.createSpec() if err := sqlgraph.CreateNode(ctx, cc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -539,7 +539,7 @@ func (ccb *CommentCreateBulk) Save(ctx context.Context) ([]*Comment, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ccb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/ent/comment_update.go b/entc/integration/ent/comment_update.go index fb9fdc4d7..5347a0925 100644 --- a/entc/integration/ent/comment_update.go +++ b/entc/integration/ent/comment_update.go @@ -246,7 +246,7 @@ func (cu *CommentUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{comment.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -509,7 +509,7 @@ func (cuo *CommentUpdateOne) sqlSave(ctx context.Context) (_node *Comment, err e if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{comment.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/ent/entql.go b/entc/integration/ent/entql.go index 8e396210f..5bff08e11 100644 --- a/entc/integration/ent/entql.go +++ b/entc/integration/ent/entql.go @@ -659,7 +659,7 @@ func (cq *CardQuery) addPredicate(pred func(s *sql.Selector)) { // Filter returns a Filter implementation to apply filters on the CardQuery builder. func (cq *CardQuery) Filter() *CardFilter { - return &CardFilter{cq.config, cq} + return &CardFilter{config: cq.config, predicateAdder: cq} } // addPredicate implements the predicateAdder interface. @@ -669,13 +669,13 @@ func (m *CardMutation) addPredicate(pred func(s *sql.Selector)) { // Filter returns an entql.Where implementation to apply filters on the CardMutation builder. func (m *CardMutation) Filter() *CardFilter { - return &CardFilter{m.config, m} + return &CardFilter{config: m.config, predicateAdder: m} } // CardFilter provides a generic filtering capability at runtime for CardQuery. type CardFilter struct { - config predicateAdder + config } // Where applies the entql predicate on the query filter. @@ -752,7 +752,7 @@ func (cq *CommentQuery) addPredicate(pred func(s *sql.Selector)) { // Filter returns a Filter implementation to apply filters on the CommentQuery builder. func (cq *CommentQuery) Filter() *CommentFilter { - return &CommentFilter{cq.config, cq} + return &CommentFilter{config: cq.config, predicateAdder: cq} } // addPredicate implements the predicateAdder interface. @@ -762,13 +762,13 @@ func (m *CommentMutation) addPredicate(pred func(s *sql.Selector)) { // Filter returns an entql.Where implementation to apply filters on the CommentMutation builder. func (m *CommentMutation) Filter() *CommentFilter { - return &CommentFilter{m.config, m} + return &CommentFilter{config: m.config, predicateAdder: m} } // CommentFilter provides a generic filtering capability at runtime for CommentQuery. type CommentFilter struct { - config predicateAdder + config } // Where applies the entql predicate on the query filter. @@ -812,7 +812,7 @@ func (ftq *FieldTypeQuery) addPredicate(pred func(s *sql.Selector)) { // Filter returns a Filter implementation to apply filters on the FieldTypeQuery builder. func (ftq *FieldTypeQuery) Filter() *FieldTypeFilter { - return &FieldTypeFilter{ftq.config, ftq} + return &FieldTypeFilter{config: ftq.config, predicateAdder: ftq} } // addPredicate implements the predicateAdder interface. @@ -822,13 +822,13 @@ func (m *FieldTypeMutation) addPredicate(pred func(s *sql.Selector)) { // Filter returns an entql.Where implementation to apply filters on the FieldTypeMutation builder. func (m *FieldTypeMutation) Filter() *FieldTypeFilter { - return &FieldTypeFilter{m.config, m} + return &FieldTypeFilter{config: m.config, predicateAdder: m} } // FieldTypeFilter provides a generic filtering capability at runtime for FieldTypeQuery. type FieldTypeFilter struct { - config predicateAdder + config } // Where applies the entql predicate on the query filter. @@ -1177,7 +1177,7 @@ func (fq *FileQuery) addPredicate(pred func(s *sql.Selector)) { // Filter returns a Filter implementation to apply filters on the FileQuery builder. func (fq *FileQuery) Filter() *FileFilter { - return &FileFilter{fq.config, fq} + return &FileFilter{config: fq.config, predicateAdder: fq} } // addPredicate implements the predicateAdder interface. @@ -1187,13 +1187,13 @@ func (m *FileMutation) addPredicate(pred func(s *sql.Selector)) { // Filter returns an entql.Where implementation to apply filters on the FileMutation builder. func (m *FileMutation) Filter() *FileFilter { - return &FileFilter{m.config, m} + return &FileFilter{config: m.config, predicateAdder: m} } // FileFilter provides a generic filtering capability at runtime for FileQuery. type FileFilter struct { - config predicateAdder + config } // Where applies the entql predicate on the query filter. @@ -1284,7 +1284,7 @@ func (ftq *FileTypeQuery) addPredicate(pred func(s *sql.Selector)) { // Filter returns a Filter implementation to apply filters on the FileTypeQuery builder. func (ftq *FileTypeQuery) Filter() *FileTypeFilter { - return &FileTypeFilter{ftq.config, ftq} + return &FileTypeFilter{config: ftq.config, predicateAdder: ftq} } // addPredicate implements the predicateAdder interface. @@ -1294,13 +1294,13 @@ func (m *FileTypeMutation) addPredicate(pred func(s *sql.Selector)) { // Filter returns an entql.Where implementation to apply filters on the FileTypeMutation builder. func (m *FileTypeMutation) Filter() *FileTypeFilter { - return &FileTypeFilter{m.config, m} + return &FileTypeFilter{config: m.config, predicateAdder: m} } // FileTypeFilter provides a generic filtering capability at runtime for FileTypeQuery. type FileTypeFilter struct { - config predicateAdder + config } // Where applies the entql predicate on the query filter. @@ -1353,7 +1353,7 @@ func (gq *GoodsQuery) addPredicate(pred func(s *sql.Selector)) { // Filter returns a Filter implementation to apply filters on the GoodsQuery builder. func (gq *GoodsQuery) Filter() *GoodsFilter { - return &GoodsFilter{gq.config, gq} + return &GoodsFilter{config: gq.config, predicateAdder: gq} } // addPredicate implements the predicateAdder interface. @@ -1363,13 +1363,13 @@ func (m *GoodsMutation) addPredicate(pred func(s *sql.Selector)) { // Filter returns an entql.Where implementation to apply filters on the GoodsMutation builder. func (m *GoodsMutation) Filter() *GoodsFilter { - return &GoodsFilter{m.config, m} + return &GoodsFilter{config: m.config, predicateAdder: m} } // GoodsFilter provides a generic filtering capability at runtime for GoodsQuery. type GoodsFilter struct { - config predicateAdder + config } // Where applies the entql predicate on the query filter. @@ -1393,7 +1393,7 @@ func (gq *GroupQuery) addPredicate(pred func(s *sql.Selector)) { // Filter returns a Filter implementation to apply filters on the GroupQuery builder. func (gq *GroupQuery) Filter() *GroupFilter { - return &GroupFilter{gq.config, gq} + return &GroupFilter{config: gq.config, predicateAdder: gq} } // addPredicate implements the predicateAdder interface. @@ -1403,13 +1403,13 @@ func (m *GroupMutation) addPredicate(pred func(s *sql.Selector)) { // Filter returns an entql.Where implementation to apply filters on the GroupMutation builder. func (m *GroupMutation) Filter() *GroupFilter { - return &GroupFilter{m.config, m} + return &GroupFilter{config: m.config, predicateAdder: m} } // GroupFilter provides a generic filtering capability at runtime for GroupQuery. type GroupFilter struct { - config predicateAdder + config } // Where applies the entql predicate on the query filter. @@ -1514,7 +1514,7 @@ func (giq *GroupInfoQuery) addPredicate(pred func(s *sql.Selector)) { // Filter returns a Filter implementation to apply filters on the GroupInfoQuery builder. func (giq *GroupInfoQuery) Filter() *GroupInfoFilter { - return &GroupInfoFilter{giq.config, giq} + return &GroupInfoFilter{config: giq.config, predicateAdder: giq} } // addPredicate implements the predicateAdder interface. @@ -1524,13 +1524,13 @@ func (m *GroupInfoMutation) addPredicate(pred func(s *sql.Selector)) { // Filter returns an entql.Where implementation to apply filters on the GroupInfoMutation builder. func (m *GroupInfoMutation) Filter() *GroupInfoFilter { - return &GroupInfoFilter{m.config, m} + return &GroupInfoFilter{config: m.config, predicateAdder: m} } // GroupInfoFilter provides a generic filtering capability at runtime for GroupInfoQuery. type GroupInfoFilter struct { - config predicateAdder + config } // Where applies the entql predicate on the query filter. @@ -1578,7 +1578,7 @@ func (iq *ItemQuery) addPredicate(pred func(s *sql.Selector)) { // Filter returns a Filter implementation to apply filters on the ItemQuery builder. func (iq *ItemQuery) Filter() *ItemFilter { - return &ItemFilter{iq.config, iq} + return &ItemFilter{config: iq.config, predicateAdder: iq} } // addPredicate implements the predicateAdder interface. @@ -1588,13 +1588,13 @@ func (m *ItemMutation) addPredicate(pred func(s *sql.Selector)) { // Filter returns an entql.Where implementation to apply filters on the ItemMutation builder. func (m *ItemMutation) Filter() *ItemFilter { - return &ItemFilter{m.config, m} + return &ItemFilter{config: m.config, predicateAdder: m} } // ItemFilter provides a generic filtering capability at runtime for ItemQuery. type ItemFilter struct { - config predicateAdder + config } // Where applies the entql predicate on the query filter. @@ -1623,7 +1623,7 @@ func (nq *NodeQuery) addPredicate(pred func(s *sql.Selector)) { // Filter returns a Filter implementation to apply filters on the NodeQuery builder. func (nq *NodeQuery) Filter() *NodeFilter { - return &NodeFilter{nq.config, nq} + return &NodeFilter{config: nq.config, predicateAdder: nq} } // addPredicate implements the predicateAdder interface. @@ -1633,13 +1633,13 @@ func (m *NodeMutation) addPredicate(pred func(s *sql.Selector)) { // Filter returns an entql.Where implementation to apply filters on the NodeMutation builder. func (m *NodeMutation) Filter() *NodeFilter { - return &NodeFilter{m.config, m} + return &NodeFilter{config: m.config, predicateAdder: m} } // NodeFilter provides a generic filtering capability at runtime for NodeQuery. type NodeFilter struct { - config predicateAdder + config } // Where applies the entql predicate on the query filter. @@ -1696,7 +1696,7 @@ func (pq *PetQuery) addPredicate(pred func(s *sql.Selector)) { // Filter returns a Filter implementation to apply filters on the PetQuery builder. func (pq *PetQuery) Filter() *PetFilter { - return &PetFilter{pq.config, pq} + return &PetFilter{config: pq.config, predicateAdder: pq} } // addPredicate implements the predicateAdder interface. @@ -1706,13 +1706,13 @@ func (m *PetMutation) addPredicate(pred func(s *sql.Selector)) { // Filter returns an entql.Where implementation to apply filters on the PetMutation builder. func (m *PetMutation) Filter() *PetFilter { - return &PetFilter{m.config, m} + return &PetFilter{config: m.config, predicateAdder: m} } // PetFilter provides a generic filtering capability at runtime for PetQuery. type PetFilter struct { - config predicateAdder + config } // Where applies the entql predicate on the query filter. @@ -1784,7 +1784,7 @@ func (sq *SpecQuery) addPredicate(pred func(s *sql.Selector)) { // Filter returns a Filter implementation to apply filters on the SpecQuery builder. func (sq *SpecQuery) Filter() *SpecFilter { - return &SpecFilter{sq.config, sq} + return &SpecFilter{config: sq.config, predicateAdder: sq} } // addPredicate implements the predicateAdder interface. @@ -1794,13 +1794,13 @@ func (m *SpecMutation) addPredicate(pred func(s *sql.Selector)) { // Filter returns an entql.Where implementation to apply filters on the SpecMutation builder. func (m *SpecMutation) Filter() *SpecFilter { - return &SpecFilter{m.config, m} + return &SpecFilter{config: m.config, predicateAdder: m} } // SpecFilter provides a generic filtering capability at runtime for SpecQuery. type SpecFilter struct { - config predicateAdder + config } // Where applies the entql predicate on the query filter. @@ -1838,7 +1838,7 @@ func (tq *TaskQuery) addPredicate(pred func(s *sql.Selector)) { // Filter returns a Filter implementation to apply filters on the TaskQuery builder. func (tq *TaskQuery) Filter() *TaskFilter { - return &TaskFilter{tq.config, tq} + return &TaskFilter{config: tq.config, predicateAdder: tq} } // addPredicate implements the predicateAdder interface. @@ -1848,13 +1848,13 @@ func (m *TaskMutation) addPredicate(pred func(s *sql.Selector)) { // Filter returns an entql.Where implementation to apply filters on the TaskMutation builder. func (m *TaskMutation) Filter() *TaskFilter { - return &TaskFilter{m.config, m} + return &TaskFilter{config: m.config, predicateAdder: m} } // TaskFilter provides a generic filtering capability at runtime for TaskQuery. type TaskFilter struct { - config predicateAdder + config } // Where applies the entql predicate on the query filter. @@ -1883,7 +1883,7 @@ func (uq *UserQuery) addPredicate(pred func(s *sql.Selector)) { // Filter returns a Filter implementation to apply filters on the UserQuery builder. func (uq *UserQuery) Filter() *UserFilter { - return &UserFilter{uq.config, uq} + return &UserFilter{config: uq.config, predicateAdder: uq} } // addPredicate implements the predicateAdder interface. @@ -1893,13 +1893,13 @@ func (m *UserMutation) addPredicate(pred func(s *sql.Selector)) { // Filter returns an entql.Where implementation to apply filters on the UserMutation builder. func (m *UserMutation) Filter() *UserFilter { - return &UserFilter{m.config, m} + return &UserFilter{config: m.config, predicateAdder: m} } // UserFilter provides a generic filtering capability at runtime for UserQuery. type UserFilter struct { - config predicateAdder + config } // Where applies the entql predicate on the query filter. diff --git a/entc/integration/ent/fieldtype_create.go b/entc/integration/ent/fieldtype_create.go index 1b903d2d0..ea0f58305 100644 --- a/entc/integration/ent/fieldtype_create.go +++ b/entc/integration/ent/fieldtype_create.go @@ -996,7 +996,7 @@ func (ftc *FieldTypeCreate) sqlSave(ctx context.Context) (*FieldType, error) { _node, _spec := ftc.createSpec() if err := sqlgraph.CreateNode(ctx, ftc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -4509,7 +4509,7 @@ func (ftcb *FieldTypeCreateBulk) Save(ctx context.Context) ([]*FieldType, error) // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ftcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/ent/fieldtype_update.go b/entc/integration/ent/fieldtype_update.go index f14539e61..4bab00b6f 100644 --- a/entc/integration/ent/fieldtype_update.go +++ b/entc/integration/ent/fieldtype_update.go @@ -2490,7 +2490,7 @@ func (ftu *FieldTypeUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{fieldtype.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -4991,7 +4991,7 @@ func (ftuo *FieldTypeUpdateOne) sqlSave(ctx context.Context) (_node *FieldType, if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{fieldtype.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/ent/file_create.go b/entc/integration/ent/file_create.go index 107f06ea4..5e93ae9cd 100644 --- a/entc/integration/ent/file_create.go +++ b/entc/integration/ent/file_create.go @@ -246,7 +246,7 @@ func (fc *FileCreate) sqlSave(ctx context.Context) (*File, error) { _node, _spec := fc.createSpec() if err := sqlgraph.CreateNode(ctx, fc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -712,7 +712,7 @@ func (fcb *FileCreateBulk) Save(ctx context.Context) ([]*File, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, fcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/ent/file_update.go b/entc/integration/ent/file_update.go index 688dbad51..d556974a2 100644 --- a/entc/integration/ent/file_update.go +++ b/entc/integration/ent/file_update.go @@ -488,7 +488,7 @@ func (fu *FileUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{file.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -990,7 +990,7 @@ func (fuo *FileUpdateOne) sqlSave(ctx context.Context) (_node *File, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{file.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/ent/filetype_create.go b/entc/integration/ent/filetype_create.go index 67e6e8b81..c2be8d598 100644 --- a/entc/integration/ent/filetype_create.go +++ b/entc/integration/ent/filetype_create.go @@ -190,7 +190,7 @@ func (ftc *FileTypeCreate) sqlSave(ctx context.Context) (*FileType, error) { _node, _spec := ftc.createSpec() if err := sqlgraph.CreateNode(ctx, ftc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -496,7 +496,7 @@ func (ftcb *FileTypeCreateBulk) Save(ctx context.Context) ([]*FileType, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ftcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/ent/filetype_update.go b/entc/integration/ent/filetype_update.go index 45bf8839e..7f5a2186e 100644 --- a/entc/integration/ent/filetype_update.go +++ b/entc/integration/ent/filetype_update.go @@ -279,7 +279,7 @@ func (ftu *FileTypeUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{filetype.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -574,7 +574,7 @@ func (ftuo *FileTypeUpdateOne) sqlSave(ctx context.Context) (_node *FileType, er if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{filetype.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/ent/goods_create.go b/entc/integration/ent/goods_create.go index 3e980c6cb..66accc5b1 100644 --- a/entc/integration/ent/goods_create.go +++ b/entc/integration/ent/goods_create.go @@ -108,7 +108,7 @@ func (gc *GoodsCreate) sqlSave(ctx context.Context) (*Goods, error) { _node, _spec := gc.createSpec() if err := sqlgraph.CreateNode(ctx, gc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -286,7 +286,7 @@ func (gcb *GoodsCreateBulk) Save(ctx context.Context) ([]*Goods, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, gcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/ent/goods_update.go b/entc/integration/ent/goods_update.go index 5638df955..4e29b8c0a 100644 --- a/entc/integration/ent/goods_update.go +++ b/entc/integration/ent/goods_update.go @@ -112,7 +112,7 @@ func (gu *GoodsUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{goods.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -241,7 +241,7 @@ func (guo *GoodsUpdateOne) sqlSave(ctx context.Context) (_node *Goods, err error if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{goods.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/ent/group_create.go b/entc/integration/ent/group_create.go index 84e4696fa..8e02bf1b4 100644 --- a/entc/integration/ent/group_create.go +++ b/entc/integration/ent/group_create.go @@ -262,7 +262,7 @@ func (gc *GroupCreate) sqlSave(ctx context.Context) (*Group, error) { _node, _spec := gc.createSpec() if err := sqlgraph.CreateNode(ctx, gc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -733,7 +733,7 @@ func (gcb *GroupCreateBulk) Save(ctx context.Context) ([]*Group, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, gcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/ent/group_update.go b/entc/integration/ent/group_update.go index dfce740c9..81659efc9 100644 --- a/entc/integration/ent/group_update.go +++ b/entc/integration/ent/group_update.go @@ -594,7 +594,7 @@ func (gu *GroupUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{group.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -1201,7 +1201,7 @@ func (guo *GroupUpdateOne) sqlSave(ctx context.Context) (_node *Group, err error if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{group.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/ent/groupinfo_create.go b/entc/integration/ent/groupinfo_create.go index be06a5ab4..1b252fb4d 100644 --- a/entc/integration/ent/groupinfo_create.go +++ b/entc/integration/ent/groupinfo_create.go @@ -159,7 +159,7 @@ func (gic *GroupInfoCreate) sqlSave(ctx context.Context) (*GroupInfo, error) { _node, _spec := gic.createSpec() if err := sqlgraph.CreateNode(ctx, gic.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -444,7 +444,7 @@ func (gicb *GroupInfoCreateBulk) Save(ctx context.Context) ([]*GroupInfo, error) // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, gicb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/ent/groupinfo_update.go b/entc/integration/ent/groupinfo_update.go index ddab51441..836ee8c97 100644 --- a/entc/integration/ent/groupinfo_update.go +++ b/entc/integration/ent/groupinfo_update.go @@ -251,7 +251,7 @@ func (giu *GroupInfoUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{groupinfo.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -518,7 +518,7 @@ func (giuo *GroupInfoUpdateOne) sqlSave(ctx context.Context) (_node *GroupInfo, if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{groupinfo.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/ent/item_create.go b/entc/integration/ent/item_create.go index a1375d36d..0fb1d5631 100644 --- a/entc/integration/ent/item_create.go +++ b/entc/integration/ent/item_create.go @@ -156,7 +156,7 @@ func (ic *ItemCreate) sqlSave(ctx context.Context) (*Item, error) { _node, _spec := ic.createSpec() if err := sqlgraph.CreateNode(ctx, ic.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -410,7 +410,7 @@ func (icb *ItemCreateBulk) Save(ctx context.Context) ([]*Item, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, icb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/ent/item_update.go b/entc/integration/ent/item_update.go index acb126c51..b930c2316 100644 --- a/entc/integration/ent/item_update.go +++ b/entc/integration/ent/item_update.go @@ -161,7 +161,7 @@ func (iu *ItemUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{item.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -339,7 +339,7 @@ func (iuo *ItemUpdateOne) sqlSave(ctx context.Context) (_node *Item, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{item.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/ent/node_create.go b/entc/integration/ent/node_create.go index ab5b7bd72..a98f8e58f 100644 --- a/entc/integration/ent/node_create.go +++ b/entc/integration/ent/node_create.go @@ -160,7 +160,7 @@ func (nc *NodeCreate) sqlSave(ctx context.Context) (*Node, error) { _node, _spec := nc.createSpec() if err := sqlgraph.CreateNode(ctx, nc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -443,7 +443,7 @@ func (ncb *NodeCreateBulk) Save(ctx context.Context) ([]*Node, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ncb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/ent/node_update.go b/entc/integration/ent/node_update.go index bd31d1f35..65f8f6a4a 100644 --- a/entc/integration/ent/node_update.go +++ b/entc/integration/ent/node_update.go @@ -279,7 +279,7 @@ func (nu *NodeUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{node.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -575,7 +575,7 @@ func (nuo *NodeUpdateOne) sqlSave(ctx context.Context) (_node *Node, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{node.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/ent/pet_create.go b/entc/integration/ent/pet_create.go index 43b78b805..c1de0ce86 100644 --- a/entc/integration/ent/pet_create.go +++ b/entc/integration/ent/pet_create.go @@ -211,7 +211,7 @@ func (pc *PetCreate) sqlSave(ctx context.Context) (*Pet, error) { _node, _spec := pc.createSpec() if err := sqlgraph.CreateNode(ctx, pc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -611,7 +611,7 @@ func (pcb *PetCreateBulk) Save(ctx context.Context) ([]*Pet, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, pcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/ent/pet_update.go b/entc/integration/ent/pet_update.go index 752aea9c7..ee10c7f66 100644 --- a/entc/integration/ent/pet_update.go +++ b/entc/integration/ent/pet_update.go @@ -348,7 +348,7 @@ func (pu *PetUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{pet.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -711,7 +711,7 @@ func (puo *PetUpdateOne) sqlSave(ctx context.Context) (_node *Pet, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{pet.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/ent/spec_create.go b/entc/integration/ent/spec_create.go index 62bbb7020..974b9bfc5 100644 --- a/entc/integration/ent/spec_create.go +++ b/entc/integration/ent/spec_create.go @@ -124,7 +124,7 @@ func (sc *SpecCreate) sqlSave(ctx context.Context) (*Spec, error) { _node, _spec := sc.createSpec() if err := sqlgraph.CreateNode(ctx, sc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -321,7 +321,7 @@ func (scb *SpecCreateBulk) Save(ctx context.Context) ([]*Spec, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, scb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/ent/spec_update.go b/entc/integration/ent/spec_update.go index 6d12fa5ba..f07818799 100644 --- a/entc/integration/ent/spec_update.go +++ b/entc/integration/ent/spec_update.go @@ -203,7 +203,7 @@ func (su *SpecUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{spec.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -422,7 +422,7 @@ func (suo *SpecUpdateOne) sqlSave(ctx context.Context) (_node *Spec, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{spec.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/ent/task_create.go b/entc/integration/ent/task_create.go index 24a440980..05b4d2187 100644 --- a/entc/integration/ent/task_create.go +++ b/entc/integration/ent/task_create.go @@ -141,7 +141,7 @@ func (tc *TaskCreate) sqlSave(ctx context.Context) (*Task, error) { _node, _spec := tc.createSpec() if err := sqlgraph.CreateNode(ctx, tc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -373,7 +373,7 @@ func (tcb *TaskCreateBulk) Save(ctx context.Context) ([]*Task, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, tcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/ent/task_update.go b/entc/integration/ent/task_update.go index ae81ae314..a6bc44a33 100644 --- a/entc/integration/ent/task_update.go +++ b/entc/integration/ent/task_update.go @@ -165,7 +165,7 @@ func (tu *TaskUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{enttask.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -345,7 +345,7 @@ func (tuo *TaskUpdateOne) sqlSave(ctx context.Context) (_node *Task, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{enttask.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/ent/user_create.go b/entc/integration/ent/user_create.go index c8cace953..c3f739def 100644 --- a/entc/integration/ent/user_create.go +++ b/entc/integration/ent/user_create.go @@ -482,7 +482,7 @@ func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { _node, _spec := uc.createSpec() if err := sqlgraph.CreateNode(ctx, uc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -1356,7 +1356,7 @@ func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ucb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/ent/user_update.go b/entc/integration/ent/user_update.go index aebccd249..778ebebc5 100644 --- a/entc/integration/ent/user_update.go +++ b/entc/integration/ent/user_update.go @@ -1327,7 +1327,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -2667,7 +2667,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/hooks/ent/card_create.go b/entc/integration/hooks/ent/card_create.go index 72291430d..211cb8e94 100644 --- a/entc/integration/hooks/ent/card_create.go +++ b/entc/integration/hooks/ent/card_create.go @@ -208,7 +208,7 @@ func (cc *CardCreate) sqlSave(ctx context.Context) (*Card, error) { _node, _spec := cc.createSpec() if err := sqlgraph.CreateNode(ctx, cc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -316,7 +316,7 @@ func (ccb *CardCreateBulk) Save(ctx context.Context) ([]*Card, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ccb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/hooks/ent/card_update.go b/entc/integration/hooks/ent/card_update.go index 1cc389c2c..ffe934385 100644 --- a/entc/integration/hooks/ent/card_update.go +++ b/entc/integration/hooks/ent/card_update.go @@ -241,7 +241,7 @@ func (cu *CardUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{card.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -497,7 +497,7 @@ func (cuo *CardUpdateOne) sqlSave(ctx context.Context) (_node *Card, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{card.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/hooks/ent/user_create.go b/entc/integration/hooks/ent/user_create.go index efcfb4a99..f93b75065 100644 --- a/entc/integration/hooks/ent/user_create.go +++ b/entc/integration/hooks/ent/user_create.go @@ -222,7 +222,7 @@ func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { _node, _spec := uc.createSpec() if err := sqlgraph.CreateNode(ctx, uc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -368,7 +368,7 @@ func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ucb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/hooks/ent/user_update.go b/entc/integration/hooks/ent/user_update.go index dd3e50bd7..02a12e329 100644 --- a/entc/integration/hooks/ent/user_update.go +++ b/entc/integration/hooks/ent/user_update.go @@ -481,7 +481,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -978,7 +978,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/idtype/ent/user_create.go b/entc/integration/idtype/ent/user_create.go index 3811ddb26..0455f7dbf 100644 --- a/entc/integration/idtype/ent/user_create.go +++ b/entc/integration/idtype/ent/user_create.go @@ -164,7 +164,7 @@ func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { _node, _spec := uc.createSpec() if err := sqlgraph.CreateNode(ctx, uc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -285,7 +285,7 @@ func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ucb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/idtype/ent/user_update.go b/entc/integration/idtype/ent/user_update.go index ebfe494bb..be32e247d 100644 --- a/entc/integration/idtype/ent/user_update.go +++ b/entc/integration/idtype/ent/user_update.go @@ -365,7 +365,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -747,7 +747,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/json/ent/user_create.go b/entc/integration/json/ent/user_create.go index 8fc9c7a16..1a914c895 100644 --- a/entc/integration/json/ent/user_create.go +++ b/entc/integration/json/ent/user_create.go @@ -182,7 +182,7 @@ func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { _node, _spec := uc.createSpec() if err := sqlgraph.CreateNode(ctx, uc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -302,7 +302,7 @@ func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ucb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/json/ent/user_update.go b/entc/integration/json/ent/user_update.go index 039fc7de0..43bbc4376 100644 --- a/entc/integration/json/ent/user_update.go +++ b/entc/integration/json/ent/user_update.go @@ -312,7 +312,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -637,7 +637,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/migrate/entv1/car_create.go b/entc/integration/migrate/entv1/car_create.go index 0410a62aa..f7f53c104 100644 --- a/entc/integration/migrate/entv1/car_create.go +++ b/entc/integration/migrate/entv1/car_create.go @@ -125,7 +125,7 @@ func (cc *CarCreate) sqlSave(ctx context.Context) (*Car, error) { _node, _spec := cc.createSpec() if err := sqlgraph.CreateNode(ctx, cc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -200,7 +200,7 @@ func (ccb *CarCreateBulk) Save(ctx context.Context) ([]*Car, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ccb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/migrate/entv1/car_update.go b/entc/integration/migrate/entv1/car_update.go index 2087fa7d2..135e47b47 100644 --- a/entc/integration/migrate/entv1/car_update.go +++ b/entc/integration/migrate/entv1/car_update.go @@ -173,7 +173,7 @@ func (cu *CarUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{car.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -362,7 +362,7 @@ func (cuo *CarUpdateOne) sqlSave(ctx context.Context) (_node *Car, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{car.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/migrate/entv1/conversion_create.go b/entc/integration/migrate/entv1/conversion_create.go index f027fb6e6..2de742fb0 100644 --- a/entc/integration/migrate/entv1/conversion_create.go +++ b/entc/integration/migrate/entv1/conversion_create.go @@ -231,7 +231,7 @@ func (cc *ConversionCreate) sqlSave(ctx context.Context) (*Conversion, error) { _node, _spec := cc.createSpec() if err := sqlgraph.CreateNode(ctx, cc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -358,7 +358,7 @@ func (ccb *ConversionCreateBulk) Save(ctx context.Context) ([]*Conversion, error // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ccb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/migrate/entv1/conversion_update.go b/entc/integration/migrate/entv1/conversion_update.go index 4893709cd..3b4a34d7a 100644 --- a/entc/integration/migrate/entv1/conversion_update.go +++ b/entc/integration/migrate/entv1/conversion_update.go @@ -521,7 +521,7 @@ func (cu *ConversionUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{conversion.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -1059,7 +1059,7 @@ func (cuo *ConversionUpdateOne) sqlSave(ctx context.Context) (_node *Conversion, if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{conversion.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/migrate/entv1/customtype_create.go b/entc/integration/migrate/entv1/customtype_create.go index 53bdf731d..61f6aaedb 100644 --- a/entc/integration/migrate/entv1/customtype_create.go +++ b/entc/integration/migrate/entv1/customtype_create.go @@ -119,7 +119,7 @@ func (ctc *CustomTypeCreate) sqlSave(ctx context.Context) (*CustomType, error) { _node, _spec := ctc.createSpec() if err := sqlgraph.CreateNode(ctx, ctc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -182,7 +182,7 @@ func (ctcb *CustomTypeCreateBulk) Save(ctx context.Context) ([]*CustomType, erro // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ctcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/migrate/entv1/customtype_update.go b/entc/integration/migrate/entv1/customtype_update.go index 639852f7a..9d1137c8d 100644 --- a/entc/integration/migrate/entv1/customtype_update.go +++ b/entc/integration/migrate/entv1/customtype_update.go @@ -145,7 +145,7 @@ func (ctu *CustomTypeUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{customtype.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -307,7 +307,7 @@ func (ctuo *CustomTypeUpdateOne) sqlSave(ctx context.Context) (_node *CustomType if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{customtype.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/migrate/entv1/user_create.go b/entc/integration/migrate/entv1/user_create.go index 9532f3d15..66bbcd789 100644 --- a/entc/integration/migrate/entv1/user_create.go +++ b/entc/integration/migrate/entv1/user_create.go @@ -366,7 +366,7 @@ func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { _node, _spec := uc.createSpec() if err := sqlgraph.CreateNode(ctx, uc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -602,7 +602,7 @@ func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ucb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/migrate/entv1/user_update.go b/entc/integration/migrate/entv1/user_update.go index ba9ac28c1..5096c5a24 100644 --- a/entc/integration/migrate/entv1/user_update.go +++ b/entc/integration/migrate/entv1/user_update.go @@ -744,7 +744,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -1504,7 +1504,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/migrate/entv2/car_create.go b/entc/integration/migrate/entv2/car_create.go index 5d1a727f6..c5f43a2f4 100644 --- a/entc/integration/migrate/entv2/car_create.go +++ b/entc/integration/migrate/entv2/car_create.go @@ -135,7 +135,7 @@ func (cc *CarCreate) sqlSave(ctx context.Context) (*Car, error) { _node, _spec := cc.createSpec() if err := sqlgraph.CreateNode(ctx, cc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -218,7 +218,7 @@ func (ccb *CarCreateBulk) Save(ctx context.Context) ([]*Car, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ccb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/migrate/entv2/car_update.go b/entc/integration/migrate/entv2/car_update.go index 4e5597604..72041f684 100644 --- a/entc/integration/migrate/entv2/car_update.go +++ b/entc/integration/migrate/entv2/car_update.go @@ -212,7 +212,7 @@ func (cu *CarUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{car.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -440,7 +440,7 @@ func (cuo *CarUpdateOne) sqlSave(ctx context.Context) (_node *Car, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{car.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/migrate/entv2/conversion_create.go b/entc/integration/migrate/entv2/conversion_create.go index 8e0b91d27..f64972281 100644 --- a/entc/integration/migrate/entv2/conversion_create.go +++ b/entc/integration/migrate/entv2/conversion_create.go @@ -231,7 +231,7 @@ func (cc *ConversionCreate) sqlSave(ctx context.Context) (*Conversion, error) { _node, _spec := cc.createSpec() if err := sqlgraph.CreateNode(ctx, cc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -358,7 +358,7 @@ func (ccb *ConversionCreateBulk) Save(ctx context.Context) ([]*Conversion, error // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ccb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/migrate/entv2/conversion_update.go b/entc/integration/migrate/entv2/conversion_update.go index 17edcb96d..63286846b 100644 --- a/entc/integration/migrate/entv2/conversion_update.go +++ b/entc/integration/migrate/entv2/conversion_update.go @@ -409,7 +409,7 @@ func (cu *ConversionUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{conversion.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -835,7 +835,7 @@ func (cuo *ConversionUpdateOne) sqlSave(ctx context.Context) (_node *Conversion, if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{conversion.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/migrate/entv2/customtype_create.go b/entc/integration/migrate/entv2/customtype_create.go index ed86e9212..e2e5ad672 100644 --- a/entc/integration/migrate/entv2/customtype_create.go +++ b/entc/integration/migrate/entv2/customtype_create.go @@ -148,7 +148,7 @@ func (ctc *CustomTypeCreate) sqlSave(ctx context.Context) (*CustomType, error) { _node, _spec := ctc.createSpec() if err := sqlgraph.CreateNode(ctx, ctc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -227,7 +227,7 @@ func (ctcb *CustomTypeCreateBulk) Save(ctx context.Context) ([]*CustomType, erro // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ctcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/migrate/entv2/customtype_update.go b/entc/integration/migrate/entv2/customtype_update.go index 04a07108c..5ccbf78b4 100644 --- a/entc/integration/migrate/entv2/customtype_update.go +++ b/entc/integration/migrate/entv2/customtype_update.go @@ -212,7 +212,7 @@ func (ctu *CustomTypeUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{customtype.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -440,7 +440,7 @@ func (ctuo *CustomTypeUpdateOne) sqlSave(ctx context.Context) (_node *CustomType if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{customtype.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/migrate/entv2/group_create.go b/entc/integration/migrate/entv2/group_create.go index 978cf4608..820b14cf2 100644 --- a/entc/integration/migrate/entv2/group_create.go +++ b/entc/integration/migrate/entv2/group_create.go @@ -105,7 +105,7 @@ func (gc *GroupCreate) sqlSave(ctx context.Context) (*Group, error) { _node, _spec := gc.createSpec() if err := sqlgraph.CreateNode(ctx, gc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -160,7 +160,7 @@ func (gcb *GroupCreateBulk) Save(ctx context.Context) ([]*Group, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, gcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/migrate/entv2/group_update.go b/entc/integration/migrate/entv2/group_update.go index 56700a3d7..6aeda94a0 100644 --- a/entc/integration/migrate/entv2/group_update.go +++ b/entc/integration/migrate/entv2/group_update.go @@ -112,7 +112,7 @@ func (gu *GroupUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{group.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -241,7 +241,7 @@ func (guo *GroupUpdateOne) sqlSave(ctx context.Context) (_node *Group, err error if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{group.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/migrate/entv2/media_create.go b/entc/integration/migrate/entv2/media_create.go index e001fd689..61922f0ac 100644 --- a/entc/integration/migrate/entv2/media_create.go +++ b/entc/integration/migrate/entv2/media_create.go @@ -147,7 +147,7 @@ func (mc *MediaCreate) sqlSave(ctx context.Context) (*Media, error) { _node, _spec := mc.createSpec() if err := sqlgraph.CreateNode(ctx, mc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -226,7 +226,7 @@ func (mcb *MediaCreateBulk) Save(ctx context.Context) ([]*Media, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, mcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/migrate/entv2/media_update.go b/entc/integration/migrate/entv2/media_update.go index 8fdb9263a..747d070cf 100644 --- a/entc/integration/migrate/entv2/media_update.go +++ b/entc/integration/migrate/entv2/media_update.go @@ -211,7 +211,7 @@ func (mu *MediaUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{media.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -439,7 +439,7 @@ func (muo *MediaUpdateOne) sqlSave(ctx context.Context) (_node *Media, err error if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{media.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/migrate/entv2/pet_create.go b/entc/integration/migrate/entv2/pet_create.go index 50dc6e214..b2a1a24be 100644 --- a/entc/integration/migrate/entv2/pet_create.go +++ b/entc/integration/migrate/entv2/pet_create.go @@ -139,7 +139,7 @@ func (pc *PetCreate) sqlSave(ctx context.Context) (*Pet, error) { _node, _spec := pc.createSpec() if err := sqlgraph.CreateNode(ctx, pc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -222,7 +222,7 @@ func (pcb *PetCreateBulk) Save(ctx context.Context) ([]*Pet, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, pcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/migrate/entv2/pet_update.go b/entc/integration/migrate/entv2/pet_update.go index 819abc428..7d906b571 100644 --- a/entc/integration/migrate/entv2/pet_update.go +++ b/entc/integration/migrate/entv2/pet_update.go @@ -206,7 +206,7 @@ func (pu *PetUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{pet.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -428,7 +428,7 @@ func (puo *PetUpdateOne) sqlSave(ctx context.Context) (_node *Pet, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{pet.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/migrate/entv2/user_create.go b/entc/integration/migrate/entv2/user_create.go index 32294b124..6fea40fc0 100644 --- a/entc/integration/migrate/entv2/user_create.go +++ b/entc/integration/migrate/entv2/user_create.go @@ -458,7 +458,7 @@ func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { _node, _spec := uc.createSpec() if err := sqlgraph.CreateNode(ctx, uc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -713,7 +713,7 @@ func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ucb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/migrate/entv2/user_update.go b/entc/integration/migrate/entv2/user_update.go index 606355d5d..2fd0cb452 100644 --- a/entc/integration/migrate/entv2/user_update.go +++ b/entc/integration/migrate/entv2/user_update.go @@ -806,7 +806,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -1626,7 +1626,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/migrate/versioned/group_create.go b/entc/integration/migrate/versioned/group_create.go index dbee1cdf8..a5f6cb3c9 100644 --- a/entc/integration/migrate/versioned/group_create.go +++ b/entc/integration/migrate/versioned/group_create.go @@ -115,7 +115,7 @@ func (gc *GroupCreate) sqlSave(ctx context.Context) (*Group, error) { _node, _spec := gc.createSpec() if err := sqlgraph.CreateNode(ctx, gc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -178,7 +178,7 @@ func (gcb *GroupCreateBulk) Save(ctx context.Context) ([]*Group, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, gcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/migrate/versioned/group_update.go b/entc/integration/migrate/versioned/group_update.go index d932e86c7..3a1e7fb2e 100644 --- a/entc/integration/migrate/versioned/group_update.go +++ b/entc/integration/migrate/versioned/group_update.go @@ -125,7 +125,7 @@ func (gu *GroupUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{group.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -267,7 +267,7 @@ func (guo *GroupUpdateOne) sqlSave(ctx context.Context) (_node *Group, err error if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{group.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/migrate/versioned/user_create.go b/entc/integration/migrate/versioned/user_create.go index b6d25cfc9..e9ff99ab7 100644 --- a/entc/integration/migrate/versioned/user_create.go +++ b/entc/integration/migrate/versioned/user_create.go @@ -143,7 +143,7 @@ func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { _node, _spec := uc.createSpec() if err := sqlgraph.CreateNode(ctx, uc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -222,7 +222,7 @@ func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ucb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/migrate/versioned/user_update.go b/entc/integration/migrate/versioned/user_update.go index e49f460af..034b9a177 100644 --- a/entc/integration/migrate/versioned/user_update.go +++ b/entc/integration/migrate/versioned/user_update.go @@ -201,7 +201,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -419,7 +419,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/multischema/ent/group_create.go b/entc/integration/multischema/ent/group_create.go index da8645fc6..f3cc24892 100644 --- a/entc/integration/multischema/ent/group_create.go +++ b/entc/integration/multischema/ent/group_create.go @@ -148,7 +148,7 @@ func (gc *GroupCreate) sqlSave(ctx context.Context) (*Group, error) { _node, _spec := gc.createSpec() if err := sqlgraph.CreateNode(ctx, gc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -233,7 +233,7 @@ func (gcb *GroupCreateBulk) Save(ctx context.Context) ([]*Group, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, gcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/multischema/ent/group_update.go b/entc/integration/multischema/ent/group_update.go index 605d03d61..0b57d19b5 100644 --- a/entc/integration/multischema/ent/group_update.go +++ b/entc/integration/multischema/ent/group_update.go @@ -230,7 +230,7 @@ func (gu *GroupUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{group.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -475,7 +475,7 @@ func (guo *GroupUpdateOne) sqlSave(ctx context.Context) (_node *Group, err error if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{group.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/multischema/ent/pet_create.go b/entc/integration/multischema/ent/pet_create.go index cf13bfc62..4b2fcc81e 100644 --- a/entc/integration/multischema/ent/pet_create.go +++ b/entc/integration/multischema/ent/pet_create.go @@ -152,7 +152,7 @@ func (pc *PetCreate) sqlSave(ctx context.Context) (*Pet, error) { _node, _spec := pc.createSpec() if err := sqlgraph.CreateNode(ctx, pc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -238,7 +238,7 @@ func (pcb *PetCreateBulk) Save(ctx context.Context) ([]*Pet, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, pcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/multischema/ent/pet_update.go b/entc/integration/multischema/ent/pet_update.go index 50e1b4b67..ecad9d7f5 100644 --- a/entc/integration/multischema/ent/pet_update.go +++ b/entc/integration/multischema/ent/pet_update.go @@ -205,7 +205,7 @@ func (pu *PetUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{pet.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -425,7 +425,7 @@ func (puo *PetUpdateOne) sqlSave(ctx context.Context) (_node *Pet, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{pet.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/multischema/ent/user_create.go b/entc/integration/multischema/ent/user_create.go index 34de09991..f5ae23811 100644 --- a/entc/integration/multischema/ent/user_create.go +++ b/entc/integration/multischema/ent/user_create.go @@ -164,7 +164,7 @@ func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { _node, _spec := uc.createSpec() if err := sqlgraph.CreateNode(ctx, uc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -269,7 +269,7 @@ func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ucb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/multischema/ent/user_update.go b/entc/integration/multischema/ent/user_update.go index d0b18679f..7fa1e7169 100644 --- a/entc/integration/multischema/ent/user_update.go +++ b/entc/integration/multischema/ent/user_update.go @@ -324,7 +324,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -662,7 +662,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/privacy/ent/entql.go b/entc/integration/privacy/ent/entql.go index 22b41c34d..384c90a37 100644 --- a/entc/integration/privacy/ent/entql.go +++ b/entc/integration/privacy/ent/entql.go @@ -155,7 +155,7 @@ func (tq *TaskQuery) addPredicate(pred func(s *sql.Selector)) { // Filter returns a Filter implementation to apply filters on the TaskQuery builder. func (tq *TaskQuery) Filter() *TaskFilter { - return &TaskFilter{tq.config, tq} + return &TaskFilter{config: tq.config, predicateAdder: tq} } // addPredicate implements the predicateAdder interface. @@ -165,13 +165,13 @@ func (m *TaskMutation) addPredicate(pred func(s *sql.Selector)) { // Filter returns an entql.Where implementation to apply filters on the TaskMutation builder. func (m *TaskMutation) Filter() *TaskFilter { - return &TaskFilter{m.config, m} + return &TaskFilter{config: m.config, predicateAdder: m} } // TaskFilter provides a generic filtering capability at runtime for TaskQuery. type TaskFilter struct { - config predicateAdder + config } // Where applies the entql predicate on the query filter. @@ -243,7 +243,7 @@ func (tq *TeamQuery) addPredicate(pred func(s *sql.Selector)) { // Filter returns a Filter implementation to apply filters on the TeamQuery builder. func (tq *TeamQuery) Filter() *TeamFilter { - return &TeamFilter{tq.config, tq} + return &TeamFilter{config: tq.config, predicateAdder: tq} } // addPredicate implements the predicateAdder interface. @@ -253,13 +253,13 @@ func (m *TeamMutation) addPredicate(pred func(s *sql.Selector)) { // Filter returns an entql.Where implementation to apply filters on the TeamMutation builder. func (m *TeamMutation) Filter() *TeamFilter { - return &TeamFilter{m.config, m} + return &TeamFilter{config: m.config, predicateAdder: m} } // TeamFilter provides a generic filtering capability at runtime for TeamQuery. type TeamFilter struct { - config predicateAdder + config } // Where applies the entql predicate on the query filter. @@ -316,7 +316,7 @@ func (uq *UserQuery) addPredicate(pred func(s *sql.Selector)) { // Filter returns a Filter implementation to apply filters on the UserQuery builder. func (uq *UserQuery) Filter() *UserFilter { - return &UserFilter{uq.config, uq} + return &UserFilter{config: uq.config, predicateAdder: uq} } // addPredicate implements the predicateAdder interface. @@ -326,13 +326,13 @@ func (m *UserMutation) addPredicate(pred func(s *sql.Selector)) { // Filter returns an entql.Where implementation to apply filters on the UserMutation builder. func (m *UserMutation) Filter() *UserFilter { - return &UserFilter{m.config, m} + return &UserFilter{config: m.config, predicateAdder: m} } // UserFilter provides a generic filtering capability at runtime for UserQuery. type UserFilter struct { - config predicateAdder + config } // Where applies the entql predicate on the query filter. diff --git a/entc/integration/privacy/ent/task_create.go b/entc/integration/privacy/ent/task_create.go index cef3c08d3..b0f7bd104 100644 --- a/entc/integration/privacy/ent/task_create.go +++ b/entc/integration/privacy/ent/task_create.go @@ -219,7 +219,7 @@ func (tc *TaskCreate) sqlSave(ctx context.Context) (*Task, error) { _node, _spec := tc.createSpec() if err := sqlgraph.CreateNode(ctx, tc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -346,7 +346,7 @@ func (tcb *TaskCreateBulk) Save(ctx context.Context) ([]*Task, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, tcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/privacy/ent/task_update.go b/entc/integration/privacy/ent/task_update.go index 2c7e4efee..b9dc091e5 100644 --- a/entc/integration/privacy/ent/task_update.go +++ b/entc/integration/privacy/ent/task_update.go @@ -386,7 +386,7 @@ func (tu *TaskUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{task.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -786,7 +786,7 @@ func (tuo *TaskUpdateOne) sqlSave(ctx context.Context) (_node *Task, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{task.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/privacy/ent/team_create.go b/entc/integration/privacy/ent/team_create.go index 3dbeabddb..637d603eb 100644 --- a/entc/integration/privacy/ent/team_create.go +++ b/entc/integration/privacy/ent/team_create.go @@ -152,7 +152,7 @@ func (tc *TeamCreate) sqlSave(ctx context.Context) (*Team, error) { _node, _spec := tc.createSpec() if err := sqlgraph.CreateNode(ctx, tc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -253,7 +253,7 @@ func (tcb *TeamCreateBulk) Save(ctx context.Context) ([]*Team, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, tcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/privacy/ent/team_update.go b/entc/integration/privacy/ent/team_update.go index aec6f0d24..033c95582 100644 --- a/entc/integration/privacy/ent/team_update.go +++ b/entc/integration/privacy/ent/team_update.go @@ -323,7 +323,7 @@ func (tu *TeamUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{team.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -661,7 +661,7 @@ func (tuo *TeamUpdateOne) sqlSave(ctx context.Context) (_node *Team, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{team.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/privacy/ent/user_create.go b/entc/integration/privacy/ent/user_create.go index 3d53f0535..1b83e3290 100644 --- a/entc/integration/privacy/ent/user_create.go +++ b/entc/integration/privacy/ent/user_create.go @@ -166,7 +166,7 @@ func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { _node, _spec := uc.createSpec() if err := sqlgraph.CreateNode(ctx, uc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -275,7 +275,7 @@ func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ucb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/privacy/ent/user_update.go b/entc/integration/privacy/ent/user_update.go index 1e88559ef..03c807c34 100644 --- a/entc/integration/privacy/ent/user_update.go +++ b/entc/integration/privacy/ent/user_update.go @@ -341,7 +341,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -697,7 +697,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/template/ent/group_create.go b/entc/integration/template/ent/group_create.go index c3b12a9e5..687a74d0c 100644 --- a/entc/integration/template/ent/group_create.go +++ b/entc/integration/template/ent/group_create.go @@ -115,7 +115,7 @@ func (gc *GroupCreate) sqlSave(ctx context.Context) (*Group, error) { _node, _spec := gc.createSpec() if err := sqlgraph.CreateNode(ctx, gc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -178,7 +178,7 @@ func (gcb *GroupCreateBulk) Save(ctx context.Context) ([]*Group, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, gcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/template/ent/group_update.go b/entc/integration/template/ent/group_update.go index 97c3ecc47..fbd165d3b 100644 --- a/entc/integration/template/ent/group_update.go +++ b/entc/integration/template/ent/group_update.go @@ -139,7 +139,7 @@ func (gu *GroupUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{group.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -295,7 +295,7 @@ func (guo *GroupUpdateOne) sqlSave(ctx context.Context) (_node *Group, err error if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{group.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/template/ent/pet_create.go b/entc/integration/template/ent/pet_create.go index e39ed77a7..1ef24e0e1 100644 --- a/entc/integration/template/ent/pet_create.go +++ b/entc/integration/template/ent/pet_create.go @@ -150,7 +150,7 @@ func (pc *PetCreate) sqlSave(ctx context.Context) (*Pet, error) { _node, _spec := pc.createSpec() if err := sqlgraph.CreateNode(ctx, pc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -241,7 +241,7 @@ func (pcb *PetCreateBulk) Save(ctx context.Context) ([]*Pet, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, pcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/template/ent/pet_update.go b/entc/integration/template/ent/pet_update.go index 6cb27c478..0b95370b7 100644 --- a/entc/integration/template/ent/pet_update.go +++ b/entc/integration/template/ent/pet_update.go @@ -234,7 +234,7 @@ func (pu *PetUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{pet.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -483,7 +483,7 @@ func (puo *PetUpdateOne) sqlSave(ctx context.Context) (_node *Pet, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{pet.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/entc/integration/template/ent/user_create.go b/entc/integration/template/ent/user_create.go index d5ba6900e..2215b25c8 100644 --- a/entc/integration/template/ent/user_create.go +++ b/entc/integration/template/ent/user_create.go @@ -146,7 +146,7 @@ func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { _node, _spec := uc.createSpec() if err := sqlgraph.CreateNode(ctx, uc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -247,7 +247,7 @@ func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ucb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/entc/integration/template/ent/user_update.go b/entc/integration/template/ent/user_update.go index 5f780a3c0..46aee1b72 100644 --- a/entc/integration/template/ent/user_update.go +++ b/entc/integration/template/ent/user_update.go @@ -306,7 +306,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -628,7 +628,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/examples/edgeindex/ent/city_create.go b/examples/edgeindex/ent/city_create.go index 8012227a6..f2c2bf357 100644 --- a/examples/edgeindex/ent/city_create.go +++ b/examples/edgeindex/ent/city_create.go @@ -131,7 +131,7 @@ func (cc *CityCreate) sqlSave(ctx context.Context) (*City, error) { _node, _spec := cc.createSpec() if err := sqlgraph.CreateNode(ctx, cc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -213,7 +213,7 @@ func (ccb *CityCreateBulk) Save(ctx context.Context) ([]*City, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ccb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/examples/edgeindex/ent/city_update.go b/examples/edgeindex/ent/city_update.go index 7e3405efb..15f863dec 100644 --- a/examples/edgeindex/ent/city_update.go +++ b/examples/edgeindex/ent/city_update.go @@ -216,7 +216,7 @@ func (cu *CityUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{city.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -448,7 +448,7 @@ func (cuo *CityUpdateOne) sqlSave(ctx context.Context) (_node *City, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{city.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/examples/edgeindex/ent/street_create.go b/examples/edgeindex/ent/street_create.go index c88610322..871d7b436 100644 --- a/examples/edgeindex/ent/street_create.go +++ b/examples/edgeindex/ent/street_create.go @@ -135,7 +135,7 @@ func (sc *StreetCreate) sqlSave(ctx context.Context) (*Street, error) { _node, _spec := sc.createSpec() if err := sqlgraph.CreateNode(ctx, sc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -218,7 +218,7 @@ func (scb *StreetCreateBulk) Save(ctx context.Context) ([]*Street, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, scb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/examples/edgeindex/ent/street_update.go b/examples/edgeindex/ent/street_update.go index 58b0d36f3..f1aee1e69 100644 --- a/examples/edgeindex/ent/street_update.go +++ b/examples/edgeindex/ent/street_update.go @@ -186,7 +186,7 @@ func (su *StreetUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{street.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -388,7 +388,7 @@ func (suo *StreetUpdateOne) sqlSave(ctx context.Context) (_node *Street, err err if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{street.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/examples/entcpkg/ent/user_create.go b/examples/entcpkg/ent/user_create.go index 38c1dbf7c..23dd72cf3 100644 --- a/examples/entcpkg/ent/user_create.go +++ b/examples/entcpkg/ent/user_create.go @@ -133,7 +133,7 @@ func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { _node, _spec := uc.createSpec() if err := sqlgraph.CreateNode(ctx, uc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -204,7 +204,7 @@ func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ucb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/examples/entcpkg/ent/user_update.go b/examples/entcpkg/ent/user_update.go index ba073cdc2..62dec674f 100644 --- a/examples/entcpkg/ent/user_update.go +++ b/examples/entcpkg/ent/user_update.go @@ -192,7 +192,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -401,7 +401,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/examples/fs/ent/file_create.go b/examples/fs/ent/file_create.go index a453958d0..8d50d2055 100644 --- a/examples/fs/ent/file_create.go +++ b/examples/fs/ent/file_create.go @@ -175,7 +175,7 @@ func (fc *FileCreate) sqlSave(ctx context.Context) (*File, error) { _node, _spec := fc.createSpec() if err := sqlgraph.CreateNode(ctx, fc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -286,7 +286,7 @@ func (fcb *FileCreateBulk) Save(ctx context.Context) ([]*File, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, fcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/examples/fs/ent/file_update.go b/examples/fs/ent/file_update.go index 8549b5751..90dca6a78 100644 --- a/examples/fs/ent/file_update.go +++ b/examples/fs/ent/file_update.go @@ -302,7 +302,7 @@ func (fu *FileUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{file.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -621,7 +621,7 @@ func (fuo *FileUpdateOne) sqlSave(ctx context.Context) (_node *File, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{file.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/examples/m2m2types/ent/group_create.go b/examples/m2m2types/ent/group_create.go index 65dcaecd8..8c91b6fca 100644 --- a/examples/m2m2types/ent/group_create.go +++ b/examples/m2m2types/ent/group_create.go @@ -131,7 +131,7 @@ func (gc *GroupCreate) sqlSave(ctx context.Context) (*Group, error) { _node, _spec := gc.createSpec() if err := sqlgraph.CreateNode(ctx, gc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -213,7 +213,7 @@ func (gcb *GroupCreateBulk) Save(ctx context.Context) ([]*Group, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, gcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/examples/m2m2types/ent/group_update.go b/examples/m2m2types/ent/group_update.go index a57706e99..04e3f9f6a 100644 --- a/examples/m2m2types/ent/group_update.go +++ b/examples/m2m2types/ent/group_update.go @@ -216,7 +216,7 @@ func (gu *GroupUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{group.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -448,7 +448,7 @@ func (guo *GroupUpdateOne) sqlSave(ctx context.Context) (_node *Group, err error if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{group.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/examples/m2m2types/ent/user_create.go b/examples/m2m2types/ent/user_create.go index 4cb491a6b..74bd2eec4 100644 --- a/examples/m2m2types/ent/user_create.go +++ b/examples/m2m2types/ent/user_create.go @@ -140,7 +140,7 @@ func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { _node, _spec := uc.createSpec() if err := sqlgraph.CreateNode(ctx, uc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -230,7 +230,7 @@ func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ucb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/examples/m2m2types/ent/user_update.go b/examples/m2m2types/ent/user_update.go index ba2ba18eb..f30be2b94 100644 --- a/examples/m2m2types/ent/user_update.go +++ b/examples/m2m2types/ent/user_update.go @@ -243,7 +243,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -502,7 +502,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/examples/m2mbidi/ent/user_create.go b/examples/m2mbidi/ent/user_create.go index dc0427282..25c16e1fa 100644 --- a/examples/m2mbidi/ent/user_create.go +++ b/examples/m2mbidi/ent/user_create.go @@ -139,7 +139,7 @@ func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { _node, _spec := uc.createSpec() if err := sqlgraph.CreateNode(ctx, uc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -229,7 +229,7 @@ func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ucb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/examples/m2mbidi/ent/user_update.go b/examples/m2mbidi/ent/user_update.go index e67d1f843..6d368ff7e 100644 --- a/examples/m2mbidi/ent/user_update.go +++ b/examples/m2mbidi/ent/user_update.go @@ -242,7 +242,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -501,7 +501,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/examples/m2mrecur/ent/user_create.go b/examples/m2mrecur/ent/user_create.go index 3ebd94358..e0af7825b 100644 --- a/examples/m2mrecur/ent/user_create.go +++ b/examples/m2mrecur/ent/user_create.go @@ -154,7 +154,7 @@ func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { _node, _spec := uc.createSpec() if err := sqlgraph.CreateNode(ctx, uc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -263,7 +263,7 @@ func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ucb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/examples/m2mrecur/ent/user_update.go b/examples/m2mrecur/ent/user_update.go index 5bc8be28e..7bbd1ce21 100644 --- a/examples/m2mrecur/ent/user_update.go +++ b/examples/m2mrecur/ent/user_update.go @@ -332,7 +332,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -681,7 +681,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/examples/o2m2types/ent/pet_create.go b/examples/o2m2types/ent/pet_create.go index a5fd69c73..8351cc4fb 100644 --- a/examples/o2m2types/ent/pet_create.go +++ b/examples/o2m2types/ent/pet_create.go @@ -135,7 +135,7 @@ func (pc *PetCreate) sqlSave(ctx context.Context) (*Pet, error) { _node, _spec := pc.createSpec() if err := sqlgraph.CreateNode(ctx, pc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -218,7 +218,7 @@ func (pcb *PetCreateBulk) Save(ctx context.Context) ([]*Pet, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, pcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/examples/o2m2types/ent/pet_update.go b/examples/o2m2types/ent/pet_update.go index b89f4feda..956bba049 100644 --- a/examples/o2m2types/ent/pet_update.go +++ b/examples/o2m2types/ent/pet_update.go @@ -186,7 +186,7 @@ func (pu *PetUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{pet.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -388,7 +388,7 @@ func (puo *PetUpdateOne) sqlSave(ctx context.Context) (_node *Pet, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{pet.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/examples/o2m2types/ent/user_create.go b/examples/o2m2types/ent/user_create.go index cd6608465..791ddd3b6 100644 --- a/examples/o2m2types/ent/user_create.go +++ b/examples/o2m2types/ent/user_create.go @@ -140,7 +140,7 @@ func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { _node, _spec := uc.createSpec() if err := sqlgraph.CreateNode(ctx, uc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -230,7 +230,7 @@ func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ucb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/examples/o2m2types/ent/user_update.go b/examples/o2m2types/ent/user_update.go index 61ef7fa1f..648082086 100644 --- a/examples/o2m2types/ent/user_update.go +++ b/examples/o2m2types/ent/user_update.go @@ -243,7 +243,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -502,7 +502,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/examples/o2mrecur/ent/node_create.go b/examples/o2mrecur/ent/node_create.go index 3cbbee902..46cb1dafa 100644 --- a/examples/o2mrecur/ent/node_create.go +++ b/examples/o2mrecur/ent/node_create.go @@ -149,7 +149,7 @@ func (nc *NodeCreate) sqlSave(ctx context.Context) (*Node, error) { _node, _spec := nc.createSpec() if err := sqlgraph.CreateNode(ctx, nc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -251,7 +251,7 @@ func (ncb *NodeCreateBulk) Save(ctx context.Context) ([]*Node, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ncb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/examples/o2mrecur/ent/node_update.go b/examples/o2mrecur/ent/node_update.go index 8b20a2bff..0888a4b94 100644 --- a/examples/o2mrecur/ent/node_update.go +++ b/examples/o2mrecur/ent/node_update.go @@ -289,7 +289,7 @@ func (nu *NodeUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{node.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -595,7 +595,7 @@ func (nuo *NodeUpdateOne) sqlSave(ctx context.Context) (_node *Node, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{node.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/examples/o2o2types/ent/card_create.go b/examples/o2o2types/ent/card_create.go index 8146b2a8c..2dbdcf692 100644 --- a/examples/o2o2types/ent/card_create.go +++ b/examples/o2o2types/ent/card_create.go @@ -140,7 +140,7 @@ func (cc *CardCreate) sqlSave(ctx context.Context) (*Card, error) { _node, _spec := cc.createSpec() if err := sqlgraph.CreateNode(ctx, cc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -231,7 +231,7 @@ func (ccb *CardCreateBulk) Save(ctx context.Context) ([]*Card, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ccb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/examples/o2o2types/ent/card_update.go b/examples/o2o2types/ent/card_update.go index 278fc5d83..122773c2e 100644 --- a/examples/o2o2types/ent/card_update.go +++ b/examples/o2o2types/ent/card_update.go @@ -206,7 +206,7 @@ func (cu *CardUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{card.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -427,7 +427,7 @@ func (cuo *CardUpdateOne) sqlSave(ctx context.Context) (_node *Card, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{card.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/examples/o2o2types/ent/user_create.go b/examples/o2o2types/ent/user_create.go index c283b4dea..fcbf30562 100644 --- a/examples/o2o2types/ent/user_create.go +++ b/examples/o2o2types/ent/user_create.go @@ -144,7 +144,7 @@ func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { _node, _spec := uc.createSpec() if err := sqlgraph.CreateNode(ctx, uc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -234,7 +234,7 @@ func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ucb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/examples/o2o2types/ent/user_update.go b/examples/o2o2types/ent/user_update.go index 18ddc8f48..5b6b74b12 100644 --- a/examples/o2o2types/ent/user_update.go +++ b/examples/o2o2types/ent/user_update.go @@ -213,7 +213,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -442,7 +442,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/examples/o2obidi/ent/user_create.go b/examples/o2obidi/ent/user_create.go index 897b2e1d1..6a121a1bc 100644 --- a/examples/o2obidi/ent/user_create.go +++ b/examples/o2obidi/ent/user_create.go @@ -143,7 +143,7 @@ func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { _node, _spec := uc.createSpec() if err := sqlgraph.CreateNode(ctx, uc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -234,7 +234,7 @@ func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ucb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/examples/o2obidi/ent/user_update.go b/examples/o2obidi/ent/user_update.go index 509ade8eb..7e9609421 100644 --- a/examples/o2obidi/ent/user_update.go +++ b/examples/o2obidi/ent/user_update.go @@ -212,7 +212,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -441,7 +441,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/examples/o2orecur/ent/node_create.go b/examples/o2orecur/ent/node_create.go index 29c601830..919af90a6 100644 --- a/examples/o2orecur/ent/node_create.go +++ b/examples/o2orecur/ent/node_create.go @@ -153,7 +153,7 @@ func (nc *NodeCreate) sqlSave(ctx context.Context) (*Node, error) { _node, _spec := nc.createSpec() if err := sqlgraph.CreateNode(ctx, nc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -255,7 +255,7 @@ func (ncb *NodeCreateBulk) Save(ctx context.Context) ([]*Node, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ncb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/examples/o2orecur/ent/node_update.go b/examples/o2orecur/ent/node_update.go index 6c66c7bda..c4ccbe958 100644 --- a/examples/o2orecur/ent/node_update.go +++ b/examples/o2orecur/ent/node_update.go @@ -259,7 +259,7 @@ func (nu *NodeUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{node.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -535,7 +535,7 @@ func (nuo *NodeUpdateOne) sqlSave(ctx context.Context) (_node *Node, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{node.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/examples/privacyadmin/ent/user_create.go b/examples/privacyadmin/ent/user_create.go index e5b85bd0e..e65353692 100644 --- a/examples/privacyadmin/ent/user_create.go +++ b/examples/privacyadmin/ent/user_create.go @@ -135,7 +135,7 @@ func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { _node, _spec := uc.createSpec() if err := sqlgraph.CreateNode(ctx, uc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -199,7 +199,7 @@ func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ucb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/examples/privacyadmin/ent/user_update.go b/examples/privacyadmin/ent/user_update.go index c02945595..1db61fc16 100644 --- a/examples/privacyadmin/ent/user_update.go +++ b/examples/privacyadmin/ent/user_update.go @@ -133,7 +133,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -283,7 +283,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/examples/privacytenant/ent/entql.go b/examples/privacytenant/ent/entql.go index 73c204e74..5fe6bab2d 100644 --- a/examples/privacytenant/ent/entql.go +++ b/examples/privacytenant/ent/entql.go @@ -128,7 +128,7 @@ func (gq *GroupQuery) addPredicate(pred func(s *sql.Selector)) { // Filter returns a Filter implementation to apply filters on the GroupQuery builder. func (gq *GroupQuery) Filter() *GroupFilter { - return &GroupFilter{gq.config, gq} + return &GroupFilter{config: gq.config, predicateAdder: gq} } // addPredicate implements the predicateAdder interface. @@ -138,13 +138,13 @@ func (m *GroupMutation) addPredicate(pred func(s *sql.Selector)) { // Filter returns an entql.Where implementation to apply filters on the GroupMutation builder. func (m *GroupMutation) Filter() *GroupFilter { - return &GroupFilter{m.config, m} + return &GroupFilter{config: m.config, predicateAdder: m} } // GroupFilter provides a generic filtering capability at runtime for GroupQuery. type GroupFilter struct { - config predicateAdder + config } // Where applies the entql predicate on the query filter. @@ -201,7 +201,7 @@ func (tq *TenantQuery) addPredicate(pred func(s *sql.Selector)) { // Filter returns a Filter implementation to apply filters on the TenantQuery builder. func (tq *TenantQuery) Filter() *TenantFilter { - return &TenantFilter{tq.config, tq} + return &TenantFilter{config: tq.config, predicateAdder: tq} } // addPredicate implements the predicateAdder interface. @@ -211,13 +211,13 @@ func (m *TenantMutation) addPredicate(pred func(s *sql.Selector)) { // Filter returns an entql.Where implementation to apply filters on the TenantMutation builder. func (m *TenantMutation) Filter() *TenantFilter { - return &TenantFilter{m.config, m} + return &TenantFilter{config: m.config, predicateAdder: m} } // TenantFilter provides a generic filtering capability at runtime for TenantQuery. type TenantFilter struct { - config predicateAdder + config } // Where applies the entql predicate on the query filter. @@ -246,7 +246,7 @@ func (uq *UserQuery) addPredicate(pred func(s *sql.Selector)) { // Filter returns a Filter implementation to apply filters on the UserQuery builder. func (uq *UserQuery) Filter() *UserFilter { - return &UserFilter{uq.config, uq} + return &UserFilter{config: uq.config, predicateAdder: uq} } // addPredicate implements the predicateAdder interface. @@ -256,13 +256,13 @@ func (m *UserMutation) addPredicate(pred func(s *sql.Selector)) { // Filter returns an entql.Where implementation to apply filters on the UserMutation builder. func (m *UserMutation) Filter() *UserFilter { - return &UserFilter{m.config, m} + return &UserFilter{config: m.config, predicateAdder: m} } // UserFilter provides a generic filtering capability at runtime for UserQuery. type UserFilter struct { - config predicateAdder + config } // Where applies the entql predicate on the query filter. diff --git a/examples/privacytenant/ent/group_create.go b/examples/privacytenant/ent/group_create.go index 3355f6df2..893a41d1c 100644 --- a/examples/privacytenant/ent/group_create.go +++ b/examples/privacytenant/ent/group_create.go @@ -166,7 +166,7 @@ func (gc *GroupCreate) sqlSave(ctx context.Context) (*Group, error) { _node, _spec := gc.createSpec() if err := sqlgraph.CreateNode(ctx, gc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -269,7 +269,7 @@ func (gcb *GroupCreateBulk) Save(ctx context.Context) ([]*Group, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, gcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/examples/privacytenant/ent/group_update.go b/examples/privacytenant/ent/group_update.go index a9f1d8a26..3fc823c6e 100644 --- a/examples/privacytenant/ent/group_update.go +++ b/examples/privacytenant/ent/group_update.go @@ -291,7 +291,7 @@ func (gu *GroupUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{group.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -597,7 +597,7 @@ func (guo *GroupUpdateOne) sqlSave(ctx context.Context) (_node *Group, err error if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{group.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/examples/privacytenant/ent/tenant_create.go b/examples/privacytenant/ent/tenant_create.go index a3c4daad6..8686e59cf 100644 --- a/examples/privacytenant/ent/tenant_create.go +++ b/examples/privacytenant/ent/tenant_create.go @@ -120,7 +120,7 @@ func (tc *TenantCreate) sqlSave(ctx context.Context) (*Tenant, error) { _node, _spec := tc.createSpec() if err := sqlgraph.CreateNode(ctx, tc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -183,7 +183,7 @@ func (tcb *TenantCreateBulk) Save(ctx context.Context) ([]*Tenant, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, tcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/examples/privacytenant/ent/tenant_update.go b/examples/privacytenant/ent/tenant_update.go index 421c78087..7e88e3a32 100644 --- a/examples/privacytenant/ent/tenant_update.go +++ b/examples/privacytenant/ent/tenant_update.go @@ -141,7 +141,7 @@ func (tu *TenantUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{tenant.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -299,7 +299,7 @@ func (tuo *TenantUpdateOne) sqlSave(ctx context.Context) (_node *Tenant, err err if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{tenant.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/examples/privacytenant/ent/user_create.go b/examples/privacytenant/ent/user_create.go index 8ef1fd120..eda5afd4d 100644 --- a/examples/privacytenant/ent/user_create.go +++ b/examples/privacytenant/ent/user_create.go @@ -172,7 +172,7 @@ func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { _node, _spec := uc.createSpec() if err := sqlgraph.CreateNode(ctx, uc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -283,7 +283,7 @@ func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ucb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/examples/privacytenant/ent/user_update.go b/examples/privacytenant/ent/user_update.go index aac6003ec..02043a40e 100644 --- a/examples/privacytenant/ent/user_update.go +++ b/examples/privacytenant/ent/user_update.go @@ -316,7 +316,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -647,7 +647,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/examples/start/ent/car_create.go b/examples/start/ent/car_create.go index 145990fec..3a5982395 100644 --- a/examples/start/ent/car_create.go +++ b/examples/start/ent/car_create.go @@ -145,7 +145,7 @@ func (cc *CarCreate) sqlSave(ctx context.Context) (*Car, error) { _node, _spec := cc.createSpec() if err := sqlgraph.CreateNode(ctx, cc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -236,7 +236,7 @@ func (ccb *CarCreateBulk) Save(ctx context.Context) ([]*Car, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ccb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/examples/start/ent/car_update.go b/examples/start/ent/car_update.go index f855bc77f..71f55daa0 100644 --- a/examples/start/ent/car_update.go +++ b/examples/start/ent/car_update.go @@ -200,7 +200,7 @@ func (cu *CarUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{car.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -415,7 +415,7 @@ func (cuo *CarUpdateOne) sqlSave(ctx context.Context) (_node *Car, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{car.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/examples/start/ent/group_create.go b/examples/start/ent/group_create.go index f7380ee02..4b347a526 100644 --- a/examples/start/ent/group_create.go +++ b/examples/start/ent/group_create.go @@ -136,7 +136,7 @@ func (gc *GroupCreate) sqlSave(ctx context.Context) (*Group, error) { _node, _spec := gc.createSpec() if err := sqlgraph.CreateNode(ctx, gc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -218,7 +218,7 @@ func (gcb *GroupCreateBulk) Save(ctx context.Context) ([]*Group, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, gcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/examples/start/ent/group_update.go b/examples/start/ent/group_update.go index 0421400e4..2240b492e 100644 --- a/examples/start/ent/group_update.go +++ b/examples/start/ent/group_update.go @@ -232,7 +232,7 @@ func (gu *GroupUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{group.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -480,7 +480,7 @@ func (guo *GroupUpdateOne) sqlSave(ctx context.Context) (_node *Group, err error if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{group.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/examples/start/ent/user_create.go b/examples/start/ent/user_create.go index 224b9bab9..3bc941026 100644 --- a/examples/start/ent/user_create.go +++ b/examples/start/ent/user_create.go @@ -178,7 +178,7 @@ func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { _node, _spec := uc.createSpec() if err := sqlgraph.CreateNode(ctx, uc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -288,7 +288,7 @@ func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ucb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/examples/start/ent/user_update.go b/examples/start/ent/user_update.go index 7ca421f8e..853ffc2f6 100644 --- a/examples/start/ent/user_update.go +++ b/examples/start/ent/user_update.go @@ -358,7 +358,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -731,7 +731,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/examples/traversal/ent/group_create.go b/examples/traversal/ent/group_create.go index 3b93687f7..a0d519842 100644 --- a/examples/traversal/ent/group_create.go +++ b/examples/traversal/ent/group_create.go @@ -150,7 +150,7 @@ func (gc *GroupCreate) sqlSave(ctx context.Context) (*Group, error) { _node, _spec := gc.createSpec() if err := sqlgraph.CreateNode(ctx, gc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -252,7 +252,7 @@ func (gcb *GroupCreateBulk) Save(ctx context.Context) ([]*Group, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, gcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/examples/traversal/ent/group_update.go b/examples/traversal/ent/group_update.go index 3a6a401f6..80820b2dd 100644 --- a/examples/traversal/ent/group_update.go +++ b/examples/traversal/ent/group_update.go @@ -276,7 +276,7 @@ func (gu *GroupUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{group.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -568,7 +568,7 @@ func (guo *GroupUpdateOne) sqlSave(ctx context.Context) (_node *Group, err error if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{group.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/examples/traversal/ent/pet_create.go b/examples/traversal/ent/pet_create.go index ea27c8b21..4e92bf95c 100644 --- a/examples/traversal/ent/pet_create.go +++ b/examples/traversal/ent/pet_create.go @@ -150,7 +150,7 @@ func (pc *PetCreate) sqlSave(ctx context.Context) (*Pet, error) { _node, _spec := pc.createSpec() if err := sqlgraph.CreateNode(ctx, pc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -252,7 +252,7 @@ func (pcb *PetCreateBulk) Save(ctx context.Context) ([]*Pet, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, pcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/examples/traversal/ent/pet_update.go b/examples/traversal/ent/pet_update.go index 84dd47616..31f3a2426 100644 --- a/examples/traversal/ent/pet_update.go +++ b/examples/traversal/ent/pet_update.go @@ -276,7 +276,7 @@ func (pu *PetUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{pet.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -568,7 +568,7 @@ func (puo *PetUpdateOne) sqlSave(ctx context.Context) (_node *Pet, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{pet.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/examples/traversal/ent/user_create.go b/examples/traversal/ent/user_create.go index 29bf64659..00e594c73 100644 --- a/examples/traversal/ent/user_create.go +++ b/examples/traversal/ent/user_create.go @@ -186,7 +186,7 @@ func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { _node, _spec := uc.createSpec() if err := sqlgraph.CreateNode(ctx, uc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -333,7 +333,7 @@ func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ucb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/examples/traversal/ent/user_update.go b/examples/traversal/ent/user_update.go index 5d195a175..780fac1f5 100644 --- a/examples/traversal/ent/user_update.go +++ b/examples/traversal/ent/user_update.go @@ -514,7 +514,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -1043,7 +1043,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } diff --git a/examples/version/ent/user_create.go b/examples/version/ent/user_create.go index 71bb12b9f..4581b3bce 100644 --- a/examples/version/ent/user_create.go +++ b/examples/version/ent/user_create.go @@ -146,7 +146,7 @@ func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { _node, _spec := uc.createSpec() if err := sqlgraph.CreateNode(ctx, uc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } @@ -218,7 +218,7 @@ func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error) { // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, ucb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } } } diff --git a/examples/version/ent/user_update.go b/examples/version/ent/user_update.go index a2271e81c..eaa93c09c 100644 --- a/examples/version/ent/user_update.go +++ b/examples/version/ent/user_update.go @@ -176,7 +176,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return 0, err } @@ -369,7 +369,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error) if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{user.Label} } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{err.Error(), err} + err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err }