fix: standardize error handling and improve resilience across SDK - #246
fix: standardize error handling and improve resilience across SDK#246luk384090-cloud wants to merge 13 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request improves error handling, parsing, and resilience across various API clients and protocols, including adding transient error retries with backoff in AsynchronousApi, extracting structured error codes and messages from JSON/non-JSON responses, and standardizing error types using the ErrorType enum. The review feedback highlights a potential NullPointerException in DashScopeResult due to auto-unboxing of a nullable Integer status code, suggests preserving a fallback error message in AgentStudioEventStream when the response body is empty, and recommends properly handling InterruptedException in AsynchronousApi instead of swallowing it.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Add AgentStudioException that converges error codes onto PublicErrorDef
(the single source of truth shared with the Python SDK). getCode()
returns the unified Anthropic-compatible code (rewriting legacy aliases
like permission_denied_error, mapping PascalCase server codes via
PublicErrorDef.fromErrorCode, and falling back to the per-status row
when the server omits one); the raw server code stays on getRawCode().
Default messages come from the registry with {var} placeholders stripped.
AsyncHelper wraps ApiException as AgentStudioException at the source so
all consumers see the unified type; joinAndUnwrap just unwraps the
CompletionException shell.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Fix CI linter (google-java-format-1.7) failures on the previous commit. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
No description provided.