Commit 8449c1e2 authored by boxjan's avatar boxjan
Browse files

Although get a EOF error, we should still know it

parent fa9ef783
Loading
Loading
Loading
Loading
+4 −8
Original line number Diff line number Diff line
@@ -157,11 +157,9 @@ func (client *s3Client) removeObjects(bucketName, prefix string) error {
		errorCh := client.minio.RemoveObjects(client.ctx, bucketName, objectsCh, opts)
		haveErrWhenRemoveObjects := false
		for e := range errorCh {
			if e.Err.Error() != "EOF" {
			glog.Errorf("Failed to remove object %s, error: %s", e.ObjectName, e.Err)
			haveErrWhenRemoveObjects = true
		}
		}
		if haveErrWhenRemoveObjects {
			return fmt.Errorf("Failed to remove all objects of bucket %s", bucketName)
		}
@@ -212,11 +210,9 @@ func (client *s3Client) removeObjectsOneByOne(bucketName, prefix string) error {

	haveErrWhenRemoveObjects := false
	for e := range removeErrCh {
		if e.Err.Error() != "EOF" {
		glog.Errorf("Failed to remove object %s, error: %s", e.ObjectName, e.Err)
		haveErrWhenRemoveObjects = true
	}
	}
	if haveErrWhenRemoveObjects {
		return fmt.Errorf("Failed to remove all objects of path %s", bucketName)
	}