You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(core)!: Use ValueError for missing 'items' in array parameters (#325)
## Overview
This PR improves the developer experience by providing more specific and actionable errors. When a tool parameter of type `array` was defined without its required `items` key, the SDK would raise a generic `Exception`. This made it difficult to distinguish this specific validation failure from other unexpected runtime exceptions.
This change corrects the behavior by raising a `ValueError`, which is the semantically appropriate exception for this scenario. The error message has also been slightly updated for consistency.
### Before
* Error Type: `Exception`
* Error Message: `"Unexpected value: type is 'list' but items is None"`
### After
* Error Type: `ValueError`
* Error Message: `"Unexpected value: type is 'array' but items is None"`
## Testing
The unit test `test_parameter_schema_array_no_items_error` has been updated to reflect these changes.
0 commit comments