aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--main.go14
1 files changed, 8 insertions, 6 deletions
diff --git a/main.go b/main.go
index 0fd5ba4..5764ae4 100644
--- a/main.go
+++ b/main.go
@@ -31,13 +31,15 @@ func processFeed(feed *feed.Feed, cfg *config.Config, client *imap.Client, wg *s
}
folder := client.NewFolder(feed.Target)
- client.EnsureFolder(folder, func(err error) string {
- return fmt.Sprintf("Creating folder of feed %s: %s", feed.Name, err)
- })
+ if err = client.EnsureFolder(folder); err != nil {
+ log.Errorf("Creating folder of feed %s: %s", feed.Name, err)
+ return
+ }
- client.PutMessages(folder, mails, func(err error) string {
- return fmt.Sprintf("Uploading messages of feed %s: %s", feed.Name, err)
- })
+ if err = client.PutMessages(folder, mails); err != nil {
+ log.Errorf("Uploading messages of feed %s: %s", feed.Name, err)
+ return
+ }
log.Printf("Uploaded %d messages to '%s' @ %s", len(mails), feed.Name, folder)
}