Skip to content

Commit

Permalink
chore: Log command errors
Browse files Browse the repository at this point in the history
  • Loading branch information
LBeernaertProton committed Dec 29, 2023
1 parent 1675148 commit ce079f1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/session/handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 {
Expand Down

0 comments on commit ce079f1

Please sign in to comment.