Skip to content

fix: standardize error message formatting across codebase #46

@rianjs

Description

@rianjs

Summary

Inconsistent error messages across the codebase.

Current State

Issues identified:

  • Some multiline with embedded instructions
  • Inconsistent capitalization
  • Some with trailing punctuation

Examples:

  • internal/gmail/client.go:45 - Multiline error with \n\nPlease download...
  • Various files mix lowercase/uppercase starts
// Current inconsistent styles:
return fmt.Errorf("Unable to read credentials file at %s: %w\n\nPlease download...", path, err)
return fmt.Errorf("failed to get message: %w", err)
return fmt.Errorf("Attachment not found.")

Proposed Solution

Follow Go conventions consistently:

  • Lowercase start
  • No trailing punctuation
  • No embedded instructions (put in help text)
// Correct style:
return fmt.Errorf("failed to read credentials file: %w", err)
return fmt.Errorf("attachment not found: %s", filename)

Priority

P3 - Code consistency

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions