mirror of
https://github.com/anthropics/claude-code-sdk-python.git
synced 2025-07-07 14:45:00 +00:00
fix: Pass proper Exception to CLIJSONDecodeError
The CLIJSONDecodeError constructor expects an Exception as the second argument, not None. Changed to pass a ValueError with details about the buffer size limit being exceeded. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
977bf6438b
commit
3ab62b617d
1 changed files with 3 additions and 1 deletions
|
@ -209,7 +209,9 @@ class SubprocessCLITransport(Transport):
|
||||||
json_buffer = "" # Clear buffer to prevent repeated errors
|
json_buffer = "" # Clear buffer to prevent repeated errors
|
||||||
raise SDKJSONDecodeError(
|
raise SDKJSONDecodeError(
|
||||||
f"JSON message exceeded maximum buffer size of {_MAX_BUFFER_SIZE} bytes",
|
f"JSON message exceeded maximum buffer size of {_MAX_BUFFER_SIZE} bytes",
|
||||||
None,
|
ValueError(
|
||||||
|
f"Buffer size {len(json_buffer)} exceeds limit {_MAX_BUFFER_SIZE}"
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue