Skip to content

Add operation and target context to inconsistent error messages#325

Merged
jwilder merged 4 commits into
masterfrom
repo-agent/repo-agent/error-messages-inconsistently-omit-operation/target-context-1-findings
Jun 10, 2026
Merged

Add operation and target context to inconsistent error messages#325
jwilder merged 4 commits into
masterfrom
repo-agent/repo-agent/error-messages-inconsistently-omit-operation/target-context-1-findings

Conversation

@jwilder

@jwilder jwilder commented Jun 10, 2026

Copy link
Copy Markdown
Owner

What changed

This PR updates error messages in main.go and template.go to consistently include operation and target context. Previously, some error paths returned messages that omitted the operation being performed or the target being acted upon, while others included it.

  • main.go: wrapped error returns to include the relevant operation/target context (3 messages updated).
  • template.go: wrapped error returns to include the relevant operation/target context (3 messages updated).
  • Added test coverage in main_test.go and template_test.go to assert that the produced error messages now contain the expected context.

Why

Inconsistent error messages made failures harder to diagnose. When an error omitted the operation or target, users and operators could not easily tell what was being attempted or which resource failed. Standardizing the messages so they always carry this context improves debuggability and produces a more predictable, uniform error-reporting experience.

This addresses 1 finding: Error messages inconsistently omit operation/target context.

How to verify

  1. Run the test suite:
    go test ./...
    
  2. Confirm the new tests in main_test.go and template_test.go pass and that they assert the presence of operation/target details in the error output.
  3. (Optional) Trigger an error path manually and confirm the message now names both the operation and the target.

jwilder added 4 commits June 10, 2026 21:04
… its error and that jsonQuery() includes the JSON object/query context in its returned errors.
…d jsonQuery() (lines 91, 95) to wrap the returned errors with the JSON object/query that failed, matching the existing 'unable to ... %s' style.
…TTP wait loop (lines 128, 139) include the scheme/addr and target URL in their log output.
…the scheme/addr being dialed, and the HTTP wait loop's 'Problem with dial'/'Problem with request' logs (lines 128, 139) to include the target URL.
@jwilder jwilder merged commit a0dbcce into master Jun 10, 2026
12 checks passed
@jwilder jwilder deleted the repo-agent/repo-agent/error-messages-inconsistently-omit-operation/target-context-1-findings branch June 10, 2026 21: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.

1 participant