From 1b97f96addb14f8a637afbe252c756a6fa66737d Mon Sep 17 00:00:00 2001 From: jce Date: Fri, 26 Jan 2024 15:21:04 +0100 Subject: [PATCH] Include configuration variable in error msg --- src/mlx/warnings/warnings.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mlx/warnings/warnings.py b/src/mlx/warnings/warnings.py index 35961afd..1c2ca7f5 100644 --- a/src/mlx/warnings/warnings.py +++ b/src/mlx/warnings/warnings.py @@ -38,7 +38,8 @@ def substitute_envvar(checker_config, keys): try: checker_config[key] = template_obj.substitute(os.environ) except KeyError as err: - raise WarningsConfigError(f"Failed to find environment variable {err}") from None + raise WarningsConfigError(f"Failed to find environment variable {err} for configuration value {key!r}")\ + from None class WarningsPlugin: