Skip to content

fix(error): map missing object errors - #6

Merged
jyxjjj merged 1 commit into
mainfrom
fix/object-not-found-error
Jul 22, 2026
Merged

fix(error): map missing object errors#6
jyxjjj merged 1 commit into
mainfrom
fix/object-not-found-error

Conversation

@Suyunmeng

Copy link
Copy Markdown
Contributor

Summary

Map 115 API error code 430004 to ErrObjectNotFound through the SDK's
standard errors.Is mechanism.

This allows callers such as OpenList to handle both missing-object response
shapes consistently:

  • data: [] returns ErrObjectNotFound.
  • state: false, code: 430004 returns *Error matching ErrObjectNotFound.

The original *Error value, error code, message, and errors.As behavior are
preserved.

Related

Testing

  • go test ./...
  • go vet ./...
  • git diff --check

Added tests covering:

  • 430004 matching ErrObjectNotFound.
  • Other error codes not matching.
  • Unrelated targets not matching.
  • Wrapped errors preserving both errors.Is and errors.As.
  • Nil error receiver behavior.

AI Disclosure

This PR includes AI-assisted content.

Tools used:

  • Claude

Usage scope:

  • Code generation
  • Tests
  • Review assistance

I reviewed and validated all AI-assisted content before submission. The commit
includes:

Co-authored-by: Claude <[email protected]>

Expose API error code 430004 through ErrObjectNotFound so callers can use the
standard errors.Is flow while retaining the original SDK error details.

Co-authored-by: Claude <[email protected]>
@jyxjjj
jyxjjj merged commit 7799bb9 into main Jul 22, 2026
@jyxjjj
jyxjjj deleted the fix/object-not-found-error branch July 22, 2026 04:19
@Suyunmeng
Suyunmeng requested review from jyxjjj and xrgzs and removed request for jyxjjj and xrgzs July 22, 2026 04:20
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.

2 participants