Skip to content

Commit c2e88c6

Browse files
committed
Don't raise raw Exception in eval
1 parent f2ad711 commit c2e88c6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pytensor/graph/basic.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -622,9 +622,9 @@ def convert_string_keys_to_variables(inputs_to_values) -> dict["Variable", Any]:
622622
if isinstance(key, str):
623623
matching_vars = get_var_by_name([self], key)
624624
if not matching_vars:
625-
raise Exception(f"{key} not found in graph")
625+
raise ValueError(f"{key} not found in graph")
626626
elif len(matching_vars) > 1:
627-
raise Exception(f"Found multiple variables with name {key}")
627+
raise ValueError(f"Found multiple variables with name {key}")
628628
new_input_to_values[matching_vars[0]] = value
629629
else:
630630
new_input_to_values[key] = value

0 commit comments

Comments
 (0)