Conversation
… 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
This PR updates error messages in
main.goandtemplate.goto 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).main_test.goandtemplate_test.goto 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
main_test.goandtemplate_test.gopass and that they assert the presence of operation/target details in the error output.