Skip to content

Document client error retryability - #5

Merged
msdmazvoid merged 1 commit into
mainfrom
feature/client-errors
Nov 7, 2026
Merged

msdmazvoid merged 1 commit into
mainfrom
feature/client-errors

Conversation

@msdmazvoid

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #4. Documents client error handling and makes retryability explicit in the generated client.

  • Adds docs/client-errors.md with a complete reason/code/HTTP-status/retryability table and retry guidance.
  • Documents which calls are safe to retry and the requirement to reuse request_id for mutations.
  • Parses google.rpc.ErrorInfo from HTTP and gRPC errors in the generated client.
  • Adds Error.Reason, Error.OperationID, and Error.Retryable, plus Error.IsRetryable(), client.IsRetryable(err), and client.ErrorInfo(err).
  • Preserves google.rpc.Status details through Error.GRPCStatus().
  • Adds tests for HTTP and gRPC retryable metadata, retryable=false overrides, code-based fallback, and ErrorInfo extraction.

Retryability notes

  • Server ErrorInfo.metadata.retryable is authoritative; IsRetryable uses it and falls back to Unavailable, DeadlineExceeded, and ResourceExhausted when metadata is absent.
  • FailedPrecondition maps to HTTP 400 under grpc-gateway defaults.
  • SESSION_ACTIVE is not immediately retryable; the initiator must log out first.
  • RESOURCE_EXHAUSTED and ADMISSION_REJECTED require backoff until capacity or concurrency changes.
  • Transport errors are not classified by IsRetryable; retry those only with the same request_id and reconcile state.

Validation

  • go build ./...
  • go vet ./...
  • go test -tags=unit ./...
  • golangci-lint run
  • make proto (generated client is reproducible)

Parse google.rpc.ErrorInfo from HTTP and gRPC errors, expose reason/operation/retryable metadata, preserve status details through GRPCStatus, and add IsRetryable/ErrorInfo helpers. Add a complete reason, HTTP status, and retry table with idempotency guidance for mutations.
@msdmazvoid
msdmazvoid merged commit 5dd27b7 into main Nov 7, 2026
2 checks passed
@msdmazvoid
msdmazvoid deleted the feature/client-errors branch November 7, 2026 02:27
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