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.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/worker/maildir/worker.go b/worker/maildir/worker.go
index 838a3b7f..a770b2f4 100644
--- a/worker/maildir/worker.go
+++ b/worker/maildir/worker.go
@@ -81,16 +81,18 @@ func (w *Worker) handleAction(action types.WorkerMessage) {
go w.handleCheckMail(msg)
default:
// Default handling, will be performed synchronously
- if err := w.handleMessage(msg); err == errUnsupported {
+ err := w.handleMessage(msg)
+ switch {
+ case errors.Is(err, errUnsupported):
w.worker.PostMessage(&types.Unsupported{
Message: types.RespondTo(msg),
}, nil)
- } else if err != nil {
+ case err != nil:
w.worker.PostMessage(&types.Error{
Message: types.RespondTo(msg),
Error: err,
}, nil)
- } else {
+ default:
w.done(msg)
}
}