Use filename from input instead of hardcoded name

This commit is contained in:
Nils Hanke 2022-05-16 14:20:21 +02:00
parent 3b30291360
commit 25b0ca2a06

View File

@ -214,7 +214,7 @@ func FromFile(fileHandler file.Handler, name string) (*Config, error) {
if err := fileHandler.ReadYAML(name, conf); err != nil {
if errors.Is(err, fs.ErrNotExist) {
return nil, fmt.Errorf("unable to find %s - use `constellation config generate` to generate it first", constants.ConfigFilename)
return nil, fmt.Errorf("unable to find %s - use `constellation config generate` to generate it first", name)
}
return nil, fmt.Errorf("could not load config from file %s: %w", name, err)
}