Skip to content

Add structured error context details to all commands#315

Merged
AndreyVMarkelov merged 1 commit into
masterfrom
feat/error-details-all-commands
Jun 30, 2026
Merged

Add structured error context details to all commands#315
AndreyVMarkelov merged 1 commit into
masterfrom
feat/error-details-all-commands

Conversation

@AndreyVMarkelov

@AndreyVMarkelov AndreyVMarkelov commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add operation, path, revision, email, member_id, from_path/to_path, url, and retry_after_seconds context to JSON error details across all commands (get, put, rm, restore, search, share-link create/list/download/info/revoke/update, cp, mv, team add/remove-member)
  • Add detailedError type and withJSONErrorDetails for wrapping errors with context without overriding the error code
  • Walk wrapped and joined errors (Unwrap() error + Unwrap() []error) to collect details from all layers
  • Add jsonErrorDetailsForCommand with auto-attach of --as-member member_id on Dropbox API errors
  • Fix false-positive api_summary detection for local path error messages
  • Add golden error output contract tests (testdata/json_contract/error_outputs.json)
  • Add subprocess integration tests validating real CLI error JSON against the schema
  • Add "JSON contract stability" section to README

Test plan

  • go test ./... passes
  • golangci-lint run clean
  • Golden error output contract audit passes
  • Subprocess integration tests pass (unknown command, auth required, structured output unsupported)
  • TestJSONErrorDetailsDoesNotTreatLocalPathAsAPISummary confirms false-positive fix
  • Team add/remove-member tests verify email details
  • All share-link command tests verify url/operation details

Add structured JSON error details for operations, paths, URLs, revisions, emails, member IDs, retry-after values, and Dropbox API summaries across file, share-link, restore, and team commands.

Collect details through wrapped and joined errors, preserve explicit command-owned details over command context, and avoid false-positive api_summary detection for local path errors.

Add golden JSON error output fixtures, schema/docs updates, and subprocess tests that validate JSON error envelopes.
@AndreyVMarkelov AndreyVMarkelov merged commit e906209 into master Jun 30, 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