Skip to content

Fix APOD API error-response decoding and add tests - #62

Merged
spiegel-im-spiegel merged 1 commit into
mainfrom
fix/apod-error-response-decode
Sep 19, 2026
Merged

spiegel-im-spiegel merged 1 commit into
mainfrom
fix/apod-error-response-decode

Conversation

@spiegel-im-spiegel

Copy link
Copy Markdown
Member

Summary

  • add ErrAPODAPIResponse to represent structured APOD API error responses
  • keep current io.TeeReader + bytes.Buffer decode structure and decode normal payload from buffered bytes
  • classify APOD API error responses by:
    • status >= http.StatusBadRequest, or
    • status == 0 && code != ""
  • avoid false APOD-error classification for non-error objects with empty code/status
  • add focused tests for normal array/single decode and APOD error-response classification

Validation

  • go test ./nasaapi/nasaapod ./nasaapi
  • go test ./...

@spiegel-im-spiegel
spiegel-im-spiegel merged commit e0d756d into main Sep 19, 2026
4 checks passed
@spiegel-im-spiegel
spiegel-im-spiegel deleted the fix/apod-error-response-decode branch September 19, 2026 03:19
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