refactor(error): unify structured error handling#3379
Draft
qin-ctx wants to merge 1 commit into
Draft
Conversation
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Unify OpenViking API, SDK, and CLI error handling around the structured
code,message, and optionaldetailscontract. Remove CLI/server message-text classification, preserve unknown upstream messages, and fix structured JSON output for CLI runtime errors.Human Involvement
Related Issue
N/A
Type of Change
Changes Made
--output jsonfor runtime errors.ABORTED, existing resources toALREADY_EXISTS, invalid URIs toINVALID_ARGUMENT, and invalid state toFAILED_PRECONDITION.Testing
Validated locally:
cargo test -q -p ov_cli— 403 passed.git diff --checkpassed for the changed error-handling paths.The broader Python selection is currently blocked by missing
watch_managerfixtures and required OpenViking config isolation on the latestmain; these failures also affect tests outside this change. The PR is intentionally opened as draft.Checklist
Screenshots (if applicable)
N/A
Additional Notes
This changes outbound public error codes. Deprecated codes such as
CONFLICT,INVALID_URI,NOT_INITIALIZED, andSESSION_EXPIREDremain accepted by compatibility clients, but new server responses use the broader canonical codes documented indocs/en/api/12-error-codes.mdanddocs/zh/api/12-error-codes.md.