aboutsummaryrefslogtreecommitdiffstats
path: root/worker/maildir/worker.go
diff options
context:
space:
mode:
Diffstat (limited to 'worker/maildir/worker.go')
-rw-r--r--worker/maildir/worker.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/worker/maildir/worker.go b/worker/maildir/worker.go
index 5ca648c4..643ab8a9 100644
--- a/worker/maildir/worker.go
+++ b/worker/maildir/worker.go
@@ -236,7 +236,7 @@ func (w *Worker) getDirectoryInfo(name string) *models.DirectoryInfo {
}
uids, err := w.c.UIDs(dir)
- if err != nil {
+ if err != nil && len(uids) == 0 {
w.worker.Errorf("could not get uids: %v", err)
return dirInfo
}
@@ -468,10 +468,16 @@ func (w *Worker) handleFetchDirectoryContents(
}
} else {
uids, err = w.c.UIDs(*w.selected)
- if err != nil {
+ if err != nil && len(uids) == 0 {
w.worker.Errorf("failed scanning uids: %v", err)
return err
}
+
+ if err != nil {
+ w.worker.PostMessage(&types.Error{
+ Error: fmt.Errorf("could not get all uids for %s: %w", *w.selected, err),
+ }, nil)
+ }
}
sortedUids, err := w.sort(msg.Context, uids, msg.SortCriteria)
if err != nil {