From eea75fcb714ded32213b80544d7e2a5dfe0de743 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Sat, 1 Jul 2017 18:55:40 -0700 Subject: [PATCH] mirror/diff: Ignore errors during objectDifference. Files which are broken in symlink, not accessible and unsupported should be ignored. We should proceed to next object. Fixes #2199 --- cmd/diff-main.go | 3 ++- cmd/mirror-url.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/diff-main.go b/cmd/diff-main.go index d3610db7c6..a904749bb9 100644 --- a/cmd/diff-main.go +++ b/cmd/diff-main.go @@ -180,7 +180,8 @@ func doDiffMain(firstURL, secondURL string) error { for diffMsg := range objectDifference(firstClient, secondClient, firstURL, secondURL) { if diffMsg.Error != nil { errorIf(diffMsg.Error, "Unable to calculate objects difference.") - break + // Ignore error and proceed to next object. + continue } printMsg(diffMsg) } diff --git a/cmd/mirror-url.go b/cmd/mirror-url.go index e591fc2949..839bc4ac78 100644 --- a/cmd/mirror-url.go +++ b/cmd/mirror-url.go @@ -99,7 +99,8 @@ func deltaSourceTarget(sourceURL string, targetURL string, isForce bool, isFake for diffMsg := range objectDifference(sourceClnt, targetClnt, sourceURL, targetURL) { if diffMsg.Error != nil { errorIf(diffMsg.Error, "Unable to mirror objects.") - break + // Ignore error and proceed to next object. + continue } switch diffMsg.Diff { case differInNone: