Handle errors coming in through List avoid crashes

This commit is contained in:
Harshavardhana
2015-10-08 16:17:37 -07:00
parent 5f6990014d
commit 0d63b236e8
+8
View File
@@ -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