Skip to content

Commit

Permalink
add more explicit error message
Browse files Browse the repository at this point in the history
  • Loading branch information
carnisj committed Jan 17, 2022
1 parent 22175c6 commit cbe3b79
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bcdi/utils/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,8 @@ def valid_item(

# check the type of obj
if value is not None and not isinstance(value, allowed_types):
raise TypeError(f"{name}: wrong type for value, allowed is {allowed_types}")
raise TypeError(f"{name}: wrong type for value, "
f"allowed is {allowed_types}, got {type(value)}")

# check min_included
if min_included is not None and value is not None:
Expand Down

0 comments on commit cbe3b79

Please sign in to comment.