Skip to content

Commit

Permalink
chore: better error message
Browse files Browse the repository at this point in the history
  • Loading branch information
thorwhalen committed Nov 7, 2024
1 parent 1da8c2b commit 0728ddf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ju/pydantic_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,8 @@ def __call__(self, data, *, assert_unique: bool = True) -> KeysReader:
model_key = self.model_classifier.matching_kind(
data, assert_unique=assert_unique
)
if model_key is None:
raise ValueError("No model matched the data.")
# get the paths for that model
paths = list(self.model_paths[model_key])
# return a mapping that lists the paths and extracts the corresponding values from the data
Expand Down

0 comments on commit 0728ddf

Please sign in to comment.