From 2cfdf690e1d661a49821d57ee1843ccafd5c0f7c Mon Sep 17 00:00:00 2001 From: Victor Morand Date: Thu, 19 Feb 2026 10:02:50 +0100 Subject: [PATCH] better error message when type mismatches --- src/experimaestro/core/types.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/experimaestro/core/types.py b/src/experimaestro/core/types.py index 32ac9686..c33b2f05 100644 --- a/src/experimaestro/core/types.py +++ b/src/experimaestro/core/types.py @@ -555,7 +555,10 @@ def addArgument(self, argument: Argument): # Check default value if argument.default is not None: - argument.type.validate(argument.default) + try: + argument.type.validate(argument.default) + except TypeError as e: + raise TypeError(f"Value {argument.default} is not valid for argument {argument.name}: {e}") def _check_override_type_compatibility( self, child_arg: Argument, parent_arg: Argument