import return err if all failed

This commit is contained in:
Umputun
2018-03-02 00:55:04 -06:00
parent b9b23a2c73
commit 2be0eace55
+5 -1
View File
@@ -68,7 +68,11 @@ func (d *Disqus) Import(r io.Reader, siteID string) (err error) {
}
log.Printf("[DEBUG] imported %d comments to site %s", passed, siteID)
return nil
if failed > 0 && passed == 0 {
err = errors.New("import failed")
}
return err
}
// convert disqus stream (xml) from reader and fill channel of comments.