Skip to content

Commit cbd5181

Browse files
claudeos-zhuang
authored andcommitted
docs(client-sdk): the error-handling example tells the truth — VALIDATION_FAILED, and category/retryable are optional
The example printed 'VALIDATION_ERROR' where data.create's validation failure actually emits VALIDATION_FAILED (the registered extension code; the batch-1 rename re-spelled the example's stale value without fixing it), and showed category/retryable as populated when no server surface emits either field today — they are optional contract fields the SDK now reads from the declared spot (#4006), set only when the server sends them. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018u8vDQLWPJxBWQESznDpSj
1 parent 0c4f5b2 commit cbd5181

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

content/docs/api/client-sdk.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -511,10 +511,10 @@ All errors follow a standardized format:
511511
try {
512512
await client.data.create('todo_task', { subject: '' });
513513
} catch (error) {
514-
console.error(error.code); // 'VALIDATION_ERROR'
515-
console.error(error.category); // 'validation'
514+
console.error(error.code); // 'VALIDATION_FAILED'
516515
console.error(error.httpStatus); // 400
517-
console.error(error.retryable); // false
516+
console.error(error.category); // optional — set only when the server sent it
517+
console.error(error.retryable); // optional — set only when the server sent it
518518
console.error(error.details); // { ... }
519519
}
520520
```

0 commit comments

Comments
 (0)