Skip to content

feat(sdk): add GIT_TRANSPORT_FAILED and GIT_REMOTE_REJECTED error types across all SDKs - #144

Open
MDzaja wants to merge 1 commit into
mainfrom
feat/git-transport-remote-rejected-errors
Open

feat(sdk): add GIT_TRANSPORT_FAILED and GIT_REMOTE_REJECTED error types across all SDKs#144
MDzaja wants to merge 1 commit into
mainfrom
feat/git-transport-remote-rejected-errors

Conversation

@MDzaja

@MDzaja MDzaja commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Description

Adds GIT_TRANSPORT_FAILED (502) and GIT_REMOTE_REJECTED (422) daemon error codes
for git transport failures (DNS/TLS/connection/timeout) and remote-side push
rejections (hooks, branch protection, quota).

Changes

  • Spec: added both codes to the DaemonErrorCode enum in
    openapi-specs/toolbox.json (targeted patch, matching the daemon's regenerated
    swagger).
  • Generated clients: regenerated all six toolbox-api-client* packages
    (TS, Go, Python, Python-async, Ruby, Java) — enum-only diffs.
  • SDK error types, mapped by (source, code) per the existing pattern, each
    inheriting from its HTTP-status class so both catch levels work:
SDK Transport (extends 502 class) Remote rejected (extends 422 class)
TypeScript DaytonaGitTransportFailedError DaytonaGitRemoteRejectedError
Python DaytonaGitTransportFailedError DaytonaGitRemoteRejectedError
Go ErrGitTransportFailed sentinel ErrGitRemoteRejected sentinel
Ruby GitTransportFailedError GitRemoteRejectedError
Java DaytonaGitTransportFailedException DaytonaGitRemoteRejectedException

Backwards compatible: older daemons that still return 500 keep surfacing
DaytonaInternalServerError; the new classes only activate on the new codes.

Example

try {
  await sandbox.git.clone(url, dir)
} catch (e) {
  if (e instanceof DaytonaGitTransportFailedError) {
    // network/DNS/TLS — retryable
  } else if (e instanceof DaytonaGitRemoteRejectedError) {
    // hook/branch-protection — fix the push, don't retry
  }
}

Summary by cubic

Add GIT_TRANSPORT_FAILED (502) and GIT_REMOTE_REJECTED (422) daemon error codes and map them to typed errors across all SDKs. This lets apps distinguish network/TLS/DNS failures from remote-side push rejections and handle them reliably.

  • New Features
    • Spec: added both codes to DaemonErrorCode in openapi-specs/toolbox.json.
    • Clients: regenerated toolbox-api-client, toolbox-api-client-go, toolbox-api-client-python, toolbox-api-client-python-async, toolbox-api-client-java (enum-only).
    • SDKs: added typed errors with status-class inheritance:
      • TypeScript: DaytonaGitTransportFailedError, DaytonaGitRemoteRejectedError
      • Python: DaytonaGitTransportFailedError, DaytonaGitRemoteRejectedError
      • Go: ErrGitTransportFailed, ErrGitRemoteRejected
      • Ruby: GitTransportFailedError, GitRemoteRejectedError
      • Java: DaytonaGitTransportFailedException, DaytonaGitRemoteRejectedException
    • Tests: added/updated mappings and inheritance checks in each SDK.
    • Backward compatible: older daemons still surface existing status-based errors.

Written for commit 114e185. Summary will update on new commits.

Review in cubic

…es across all SDKs

Signed-off-by: MDzaja <mirkodzaja0@gmail.com>
@vidoc-agent

vidoc-agent Bot commented Jul 27, 2026

Copy link
Copy Markdown

Vidoc security review

Tip

Good to merge — no security issues found. Reviewed 21 changed files.

💬 Have questions? Tag @vidoc in a comment and I'll answer.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 21 files

Re-trigger cubic

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