Skip to content

Commit

Permalink
fix: Update()没有处理ErrConflict转换
Browse files Browse the repository at this point in the history
  • Loading branch information
yeaha committed Oct 26, 2022
1 parent 07a6300 commit 4d9451b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions entity.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,9 @@ func Update(ctx context.Context, ent Entity, db DB) error {
}

if err := doUpdate(ctx, ent, db); err != nil {
if isConflictError(err, dbDriver(db)) {
return ErrConflict
}
return err
}

Expand Down

0 comments on commit 4d9451b

Please sign in to comment.