Skip to content

fix(smtp): normalize error messages to Go convention#24

Merged
veverkap merged 3 commits into
mainfrom
copilot/fix-smtp-error-messages
Apr 17, 2026
Merged

fix(smtp): normalize error messages to Go convention#24
veverkap merged 3 commits into
mainfrom
copilot/fix-smtp-error-messages

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 17, 2026

Error messages in smtp/smtp.go violated Go conventions by using capitalized prefixes ("SMTP host required", "SMTP from address required"). Go errors must be lowercase with no trailing period.

Changes

  • smtp/smtp.go: Lowercased two non-conforming error strings to match the style of existing errors in the same function:
    // Before
    fmt.Errorf("SMTP host required")
    fmt.Errorf("SMTP from address required")
    
    // After
    fmt.Errorf("host required")
    fmt.Errorf("from address required")

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts SMTP configuration validation errors to better align with Go’s error-string conventions (lowercase, no trailing period) within the smtp package.

Changes:

  • Lowercased the “host required” validation error returned when Config.Host is empty.
  • Lowercased the “from address required” validation error returned when Config.From is empty.
Show a summary per file
File Description
smtp/smtp.go Normalizes two validation error strings returned by Config.Validate().

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 2

Comment thread smtp/smtp.go Outdated
Comment thread smtp/smtp.go Outdated
Comment on lines +66 to +70
return Params{}, fmt.Errorf("host required")
}
from := strings.TrimSpace(c.From)
if from == "" {
return Params{}, fmt.Errorf("SMTP from address required")
return Params{}, fmt.Errorf("from address required")
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR description claims SMTP error messages are normalized to Go conventions, but this file still returns several capitalized error prefixes (e.g., "SMTP connection failed", "SMTP client failed", "SMTP auth failed"). Either update those as well or narrow the PR description/scope so it matches the actual changes.

Copilot uses AI. Check for mistakes.
veverkap and others added 2 commits April 17, 2026 13:23
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@veverkap veverkap merged commit 19d3e58 into main Apr 17, 2026
6 checks passed
@veverkap veverkap deleted the copilot/fix-smtp-error-messages branch April 17, 2026 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants