aboutsummaryrefslogtreecommitdiffstats
path: root/worker/worker.go
diff options
context:
space:
mode:
Diffstat (limited to 'worker/worker.go')
-rw-r--r--worker/worker.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/worker/worker.go b/worker/worker.go
index dd14a239..a37927e7 100644
--- a/worker/worker.go
+++ b/worker/worker.go
@@ -29,7 +29,11 @@ func NewWorker(source string, logger *log.Logger) (*types.Worker, error) {
case "imaps":
worker.Backend = imap.NewIMAPWorker(worker)
case "maildir":
- worker.Backend = maildir.NewWorker(worker)
+ if w, err := maildir.NewWorker(worker); err != nil {
+ return nil, fmt.Errorf("could not create maildir worker: %v", err)
+ } else {
+ worker.Backend = w
+ }
default:
return nil, fmt.Errorf("Unknown backend %s", u.Scheme)
}