Browse Source

Include required but missing VAR name and assignment in interpolation error message.

Error message format is now e.g.:

ERROR: Missing mandatory value for "environment" option interpolating ['MYENV=${MYVAR:?}'] in service "myservice":

Fixed #6587.

Signed-off-by: Brett Randall <[email protected]>
Brett Randall 6 years ago
parent
commit
fb4d5aa7e6
1 changed files with 6 additions and 6 deletions
  1. 6 6
      compose/config/interpolation.py

+ 6 - 6
compose/config/interpolation.py

@@ -64,12 +64,12 @@ def interpolate_value(name, config_key, value, section, interpolator):
                 string=e.string))
     except UnsetRequiredSubstitution as e:
         raise ConfigurationError(
-            'Missing mandatory value for "{config_key}" option in {section} "{name}": {err}'.format(
-                config_key=config_key,
-                name=name,
-                section=section,
-                err=e.err
-            )
+            'Missing mandatory value for "{config_key}" option interpolating {value} '
+            'in {section} "{name}": {err}'.format(config_key=config_key,
+                                                  value=value,
+                                                  name=name,
+                                                  section=section,
+                                                  err=e.err)
         )