Use wrapped error so that ErrNoObjectsVisited can be compared after return.

Signed-off-by: Xin Ruan <xin.ruan@sap.com>
pull/11591/head
Xin Ruan 2 years ago
parent 21e694e0f9
commit f01486a0ef

@ -325,10 +325,8 @@ func (c *Client) Delete(resources ResourceList) (*Result, []error) {
return nil
})
if err != nil {
// Rewrite the message from "no objects visited" if that is what we got
// back
if err == ErrNoObjectsVisited {
err = errors.New("object not found, skipping delete")
err = fmt.Errorf("object not found, skipping delete: %w", ErrNoObjectsVisited)
}
errs = append(errs, err)
}

Loading…
Cancel
Save