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

View File

@ -10,5 +10,5 @@ type Config struct {
} }
func Start(ctx context.Context, config Config) error { func Start(ctx context.Context, config Config) error {
return errors.ThrowUnimplemented(nil, "", "") //TODO: implement return errors.ThrowUnimplemented(nil, "ADMIN-n8vw5", "not implemented yet") //TODO: implement
} }

View File

@ -10,5 +10,5 @@ type Config struct {
} }
func Start(ctx context.Context, config Config) error { func Start(ctx context.Context, config Config) error {
return errors.ThrowUnimplemented(nil, "", "") //TODO: implement return errors.ThrowUnimplemented(nil, "AUTH-l7Hdx", "not implemented yet") //TODO: implement
} }

View File

@ -10,5 +10,5 @@ type Config struct {
} }
func Start(ctx context.Context, config Config) error { func Start(ctx context.Context, config Config) error {
return errors.ThrowUnimplemented(nil, "", "") //TODO: implement return errors.ThrowUnimplemented(nil, "EVENT-1hfiu", "not implemented yet") //TODO: implement
} }

View File

@ -10,5 +10,5 @@ type Config struct {
} }
func Start(ctx context.Context, config Config) error { func Start(ctx context.Context, config Config) error {
return errors.ThrowUnimplemented(nil, "", "") //TODO: implement return errors.ThrowUnimplemented(nil, "MANAG-h3k3x", "not implemented yet") //TODO: implement
} }