Skip to content

Commit 4c69d30

Browse files
Copilotlpcox
andcommitted
Address code review feedback: add comments and clarify error format
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
1 parent bd96e30 commit 4c69d30

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

internal/config/config_core.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ func LoadFromFile(path string) (*Config, error) {
106106
md, err := decoder.Decode(&cfg)
107107
if err != nil {
108108
// Extract position information from ParseError for better error messages
109+
// Note: We use Position.Line, Position.Col, and Message separately to provide
110+
// a consistent, precise error format. perr.Error() includes line info but not
111+
// column, so we construct our own message with both for better UX.
109112
// Try pointer type first (for compatibility)
110113
if perr, ok := err.(*toml.ParseError); ok {
111114
return nil, fmt.Errorf("failed to parse TOML at line %d, column %d: %s",

0 commit comments

Comments
 (0)