diff --git a/src/tdastro/base_models.py b/src/tdastro/base_models.py index a9e51407..fac27687 100644 --- a/src/tdastro/base_models.py +++ b/src/tdastro/base_models.py @@ -71,7 +71,7 @@ def add_parameter(self, name, value=None, required=False, **kwargs): Raise a ``ValueError`` if the parameter is required, but set to None. """ if hasattr(self, name) and getattr(self, name) is not None: - raise KeyError(f"Duplicate parameter set: {KeyError}") + raise KeyError(f"Duplicate parameter set: {name}") if value is None and name in kwargs: # The value wasn't set, but the name is in kwargs.