Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: #4273 - courier http channel - Include error response from email service provider in courier logs #4274

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions courier/http_channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package courier

import (
"bytes"
"context"
"encoding/json"
"fmt"
Expand Down Expand Up @@ -105,9 +106,11 @@ func (c *httpChannel) Dispatch(ctx context.Context, msg Message) (err error) {
}

err = errors.Errorf(
"unable to dispatch mail delivery because upstream server replied with status code %d",
res.StatusCode,
"unable to dispatch mail delivery because upstream server replied with status code %d and body: %s",
res.StatusCode,
bytes.NewBuffer(x.MustReadAll(res.Body)).String(),
)

logger.
WithError(err).
Error("sending mail via HTTP failed.")
Expand Down
Loading