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:
Lina Tawfik 2025-06-30 22:02:02 -07:00
parent 977bf6438b
commit 3ab62b617d
No known key found for this signature in database

View file

@ -209,7 +209,9 @@ class SubprocessCLITransport(Transport):
json_buffer = "" # Clear buffer to prevent repeated errors
raise SDKJSONDecodeError(
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: