From cbe3b7960414b03f8e98336c3fcd7b367de441ca Mon Sep 17 00:00:00 2001 From: Jerome Carnis Date: Mon, 17 Jan 2022 21:02:25 +0100 Subject: [PATCH] add more explicit error message --- bcdi/utils/validation.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bcdi/utils/validation.py b/bcdi/utils/validation.py index ac8911208..8b23a9b74 100644 --- a/bcdi/utils/validation.py +++ b/bcdi/utils/validation.py @@ -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: