From 14ab1b4413576c33ff0138aea078c25ec005d22f Mon Sep 17 00:00:00 2001 From: Leander Beernaert Date: Wed, 27 Dec 2023 14:32:25 +0100 Subject: [PATCH] chore: Log command errors --- internal/session/handle.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/session/handle.go b/internal/session/handle.go index 6935fc03..0a3a3ec9 100644 --- a/internal/session/handle.go +++ b/internal/session/handle.go @@ -3,6 +3,7 @@ package session import ( "context" "fmt" + "github.com/sirupsen/logrus" "github.com/ProtonMail/gluon/imap/command" "github.com/ProtonMail/gluon/internal/response" @@ -22,6 +23,7 @@ func (s *Session) handleOther( defer close(resCh) if err := s.handleCommand(ctx, tag, cmd, resCh); err != nil { + logrus.WithError(err).WithField("cmd", cmd.SanitizedString()).Error("Command failed") if res, ok := response.FromError(err); ok { resCh <- res } else {