mirror of
https://github.com/ent/ent.git
synced 2026-04-30 06:30:55 +03:00
avoid multiple rows.Err calls on error path
Signed-off-by: Alex Snast <alexsn@fb.com>
This commit is contained in:
@@ -723,8 +723,8 @@ func (u *updater) setTableColumns(update *sql.UpdateBuilder, addEdges, clearEdge
|
||||
func (u *updater) scan(rows *sql.Rows) error {
|
||||
defer rows.Close()
|
||||
if !rows.Next() {
|
||||
if rows.Err() != nil {
|
||||
return rows.Err()
|
||||
if err := rows.Err(); err != nil {
|
||||
return err
|
||||
}
|
||||
return &NotFoundError{table: u.Node.Table, id: u.Node.ID.Value}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user