From 0d63b236e8f8701294dd2ca7a6173c134c3a8a40 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Thu, 8 Oct 2015 16:17:37 -0700 Subject: [PATCH] Handle errors coming in through List avoid crashes --- diff.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/diff.go b/diff.go index ea02dc7f..b360ad58 100644 --- a/diff.go +++ b/diff.go @@ -261,6 +261,10 @@ func dodiffRecursive(firstClnt, secondClnt client.Client, ch chan DiffMessage) { if fok == false { break } + if f.Err != nil { + ch <- DiffMessage{Error: f.Err.Trace()} + continue + } if f.Content.Type.IsDir() { // skip directories // there is no concept of directories on S3 @@ -279,6 +283,10 @@ func dodiffRecursive(firstClnt, secondClnt client.Client, ch chan DiffMessage) { f, fok = <-fch continue } + if s.Err != nil { + ch <- DiffMessage{Error: s.Err.Trace()} + continue + } if s.Content.Type.IsDir() { // skip directories s, sok = <-sch