Skip to content

Commit ae737a7

Browse files
authored
Merge branch 'main' into anubhav-map
2 parents 49659ef + b43409e commit ae737a7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/toolbox-core/src/toolbox_core/protocol.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def __get_type(self) -> Type:
4343
base_type = bool
4444
elif self.type == "array":
4545
if self.items is None:
46-
raise Exception("Unexpected value: type is 'list' but items is None")
46+
raise ValueError("Unexpected value: type is 'array' but items is None")
4747
base_type = list[self.items.__get_type()] # type: ignore
4848
elif self.type == "object":
4949
if isinstance(self.AdditionalProperties, ParameterSchema):

packages/toolbox-core/tests/test_protocol.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,11 @@ def test_parameter_schema_array_no_items_error():
8686
name="bad_list", type="array", description="List without item type"
8787
)
8888

89-
expected_error_msg = "Unexpected value: type is 'list' but items is None"
90-
with pytest.raises(Exception, match=expected_error_msg):
89+
expected_error_msg = "Unexpected value: type is 'array' but items is None"
90+
with pytest.raises(ValueError, match=expected_error_msg):
9191
schema._ParameterSchema__get_type()
9292

93-
with pytest.raises(Exception, match=expected_error_msg):
93+
with pytest.raises(ValueError, match=expected_error_msg):
9494
schema.to_param()
9595

9696

0 commit comments

Comments
 (0)