return error on file not found and added log ids and messages

This commit is contained in:
Livio Amstutz
2020-03-19 08:32:47 +01:00
parent af8905036b
commit 7ef62528d1
5 changed files with 5 additions and 7 deletions

View File

@@ -7,7 +7,6 @@ import (
"path/filepath"
"github.com/BurntSushi/toml"
"github.com/caos/logging"
"github.com/ghodss/yaml"
"github.com/caos/zitadel/internal/errors"
@@ -62,8 +61,7 @@ func readConfigFile(configReader Reader, configFile string, obj interface{}) err
configFile = os.ExpandEnv(configFile)
if _, err := os.Stat(configFile); err != nil {
logging.LogWithFields("CONFI-Hs93M", "file", configFile).WithError(err).Warn("config file does not exist")
return nil
return errors.ThrowNotFoundf(err, "CONFI-Hs93M", "config file %s does not exist", configFile)
}
configStr, err := ioutil.ReadFile(configFile)