fix(sdk): propagate missing daemon error codes to all SDKs and document list() response shapes - #149
Merged
Merged
Conversation
…nt list() response shapes Signed-off-by: MDzaja <mirkodzaja0@gmail.com>
Vidoc security reviewTip Good to merge — no security issues found. Reviewed 45 changed files. 💬 Have questions? Tag @vidoc in a comment and I'll answer. |
Signed-off-by: MDzaja <mirkodzaja0@gmail.com>
There was a problem hiding this comment.
Review completed against the latest diff
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 14 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Signed-off-by: MDzaja <mirkodzaja0@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two related agent-experience fixes across all five SDKs.
1. Error-code parity (behavioural fix)
INVALID_FILE_PATHandFILE_READ_FAILEDwere added to the TypeScript SDK in #146 butnever propagated, so Python, Ruby, Go and Java silently degraded to generic
status-based errors for codes the daemon really emits.
Verified against production:
INVALID_FILE_PATH(400)DaytonaBadRequestErrorDaytonaInvalidFilePathErrorFILE_READ_FAILED(500)DaytonaInternalServerErrorDaytonaFileReadFailedErrorParents match TypeScript (400 → bad request, 500 → internal server error). Go uses
sentinels +
errors.Is, consistent with its existing design. Purely additive — noexisting class, mapping or signature changed.
2.
list()response shapes (docs)snapshot.list()returns a wrapper ({ items: [...] }), not an array, but every exampleread as though it were — so
.map()on the result throws. Added a "List method returnshapes" table to each SDK README and made the wrapper explicit in the doc-comments.
Also fixed 22 Go doc examples that referenced non-existent accessors
(
client.Snapshots/client.Volumes; the real fields are singularclient.Snapshot/client.Volume) — these could never have compiled. Caught by executing the examplesrather than reading them.
Plus:
sdk-rubynow documents the existing>= 3.2requirement from its gemspec, andsdk-java's README uses a self-updating Maven Central badge instead of a hardcodedversion.
Summary by cubic
Propagates missing daemon filesystem error codes to all SDKs and clarifies
list()return shapes with concise examples and corrected Go accessors.Bug Fixes
INVALID_FILE_PATH(400) andFILE_READ_FAILED(500) tosdk-python,sdk-ruby,sdk-go, andsdk-java; Go exposesErrInvalidFilePath/ErrFileReadFailed; JavaExceptionMapperwired; tests added across Go/Java/Python/Ruby.Docs
sdk-typescript,sdk-python,sdk-ruby,sdk-go, andsdk-javaREADMEs/docs; examples use.items/getters, destructure results in TypeScript, and print page/total counts; Go examples fixed toclient.Snapshot/client.Volume.sdk-rubyREADME notes Ruby >= 3.2;sdk-javaREADME includes a Maven Central badge.Written for commit c4a47bc. Summary will update on new commits.