Skip to content

Add structured JSON error details#291

Merged
AndreyVMarkelov merged 2 commits into
masterfrom
codex/json-error-details
Jun 25, 2026
Merged

Add structured JSON error details#291
AndreyVMarkelov merged 2 commits into
masterfrom
codex/json-error-details

Conversation

@AndreyVMarkelov

@AndreyVMarkelov AndreyVMarkelov commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add optional error.details object to JSON error responses with machine-readable context
  • Include path in details for path conflict errors
  • Include token_type, login_command, and env_var in details for auth errors (remediation info)
  • Include api_summary in details for Dropbox API errors
  • Details are omitted (omitempty) when no structured context is available

Test plan

  • All existing tests pass
  • TestRenderCommandErrorIncludesCodedDetails verifies details.path for path conflicts
  • TestRenderCommandErrorIncludesDropboxAPISummaryDetails verifies details.api_summary for SDK errors
  • TestJSONErrorDetailsIncludesAuthRemediation verifies auth remediation fields
  • Existing error test verifies details is omitted for generic errors
  • Contract test validates details property exists in error schema
  • gofmt, go vet, golangci-lint all pass

AndreyVMarkelov and others added 2 commits June 25, 2026 14:00
Publish command catalog, eliminate unknown types, and harden schema
Add optional error.details to JSON error responses for stable machine-readable remediation context. Populate auth remediation fields, path conflicts, and Dropbox API summaries while omitting details for generic local failures.

Document the optional details contract and extend schema/tests to keep it covered.
@AndreyVMarkelov AndreyVMarkelov merged commit ed5fa89 into master Jun 25, 2026
7 checks passed
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