summary refs log tree commit diff stats
path: root/worker/maildir
diff options
context:
space:
mode:
authorJeffas <dev@jeffas.io>2020-02-26 20:02:58 +0000
committerReto Brunner <reto@labrat.space>2020-02-26 21:46:35 +0100
commitd6696f34b83044d4b9e7e714e75b8ff02d54cbc0 (patch)
tree989ea2af3b3af3a79fb914439359a49dace93b36 /worker/maildir
parent00ed2ef06a9bfb35d05c33948cbd93c03153636a (diff)
downloadaerc-d6696f34b83044d4b9e7e714e75b8ff02d54cbc0.tar.gz
Make search more lenient
When we fail to read a single message we don't need to fail the whole
search, just log the error and we can still get results back.
Diffstat (limited to 'worker/maildir')
-rw-r--r--worker/maildir/search.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/worker/maildir/search.go b/worker/maildir/search.go
index 47eab6a..f658c02 100644
--- a/worker/maildir/search.go
+++ b/worker/maildir/search.go
@@ -80,7 +80,8 @@ func (w *Worker) search(criteria *searchCriteria) ([]uint32, error) {
 	for _, key := range keys {
 		success, err := w.searchKey(key, criteria, requiredParts)
 		if err != nil {
-			return nil, err
+			// don't return early so that we can still get some results
+			w.worker.Logger.Printf("Failed to search key %v: %v", key, err)
 		} else if success {
 			matchedUids = append(matchedUids, key)
 		}