Skip to content

Include raw JSON response body in PodcastIndex API unmarshal errors#385

Merged
andygrunwald merged 1 commit intomainfrom
json-error
Feb 8, 2026
Merged

Include raw JSON response body in PodcastIndex API unmarshal errors#385
andygrunwald merged 1 commit intomainfrom
json-error

Conversation

@andygrunwald
Copy link
Copy Markdown
Contributor

Summary

  • When JSON unmarshalling of PodcastIndex API responses fails, the error now includes the raw response body for easier debugging
  • Switches from streaming json.NewDecoder to io.ReadAll + json.Unmarshal so the body is available on error
  • Wraps the original error with fmt.Errorf("%w: ...") to preserve error chain for errors.Is/errors.As

Test plan

  • go build ./... passes
  • go vet ./... passes
  • Verify in production that malformed API responses now show the raw JSON in logs

🤖 Generated with Claude Code

When the PodcastIndex API returns unexpected JSON structures, the error
message now includes the raw response body to aid debugging.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@andygrunwald andygrunwald merged commit 821f34e into main Feb 8, 2026
5 checks passed
@andygrunwald andygrunwald deleted the json-error branch February 8, 2026 09:48
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