Skip to content

Fix API error fallback when structured payload is missing#421

Draft
fhacloid wants to merge 1 commit intodevelopfrom
cursor/CLI-109-cli-error-message-fallback-ed25
Draft

Fix API error fallback when structured payload is missing#421
fhacloid wants to merge 1 commit intodevelopfrom
cursor/CLI-109-cli-error-message-fallback-ed25

Conversation

@fhacloid
Copy link
Contributor

Summary

  • add a fallback in APIResponseError.Error() to show raw response body when models.ErrorPayload cannot be parsed
  • include request Path in APIResponseError (captured from resp.Request.URL.RequestURI()) so fallback messages include the user request path
  • add middleware tests covering fallback with and without path and request-path capture in newAPIResponseError
  • document the updated APIResponseError fallback behavior in docs/architecture.md

Testing

  • go test ./cmd/cycloid/middleware -run 'TestAPIResponseError|TestNewAPIResponseError_PathFallback' -count=1 ❌ (environment cannot download Go 1.25 toolchain)
  • make format ❌ (missing Go 1.25 toolchain and gci in environment)
  • make lint ❌ (missing Go 1.25 toolchain and golangci-lint in environment)

Linear Issue: CLI-109

Open in Web Open in Cursor 

Co-authored-by: fhacloid <fhacloid@users.noreply.github.com>
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.

2 participants