mirror of https://github.com/databricks/cli.git
Use clearer error message when no interpolation value is found. (#764)
## Changes This PR makes the error message clearer for when interpolation fails. ## Tests Existing unit test and manually
This commit is contained in:
parent
44726d6444
commit
373f441eb2
|
@ -184,7 +184,7 @@ func (a *accumulator) Resolve(path string, seenPaths []string, fns ...LookupFunc
|
||||||
// fetch the string node to resolve
|
// fetch the string node to resolve
|
||||||
field, ok := a.strings[path]
|
field, ok := a.strings[path]
|
||||||
if !ok {
|
if !ok {
|
||||||
return fmt.Errorf("could not resolve reference %s", path)
|
return fmt.Errorf("no value found for interpolation reference: ${%s}", path)
|
||||||
}
|
}
|
||||||
|
|
||||||
// return early if the string field has no variables to interpolate
|
// return early if the string field has no variables to interpolate
|
||||||
|
|
|
@ -247,5 +247,5 @@ func TestInterpolationInvalidVariableReference(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
err := expand(&config)
|
err := expand(&config)
|
||||||
assert.ErrorContains(t, err, "could not resolve reference vars.foo")
|
assert.ErrorContains(t, err, "no value found for interpolation reference: ${vars.foo}")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue