diff --git a/core/backend/tts.go b/core/backend/tts.go index c3f9619c577c..c5f5d2159f50 100644 --- a/core/backend/tts.go +++ b/core/backend/tts.go @@ -44,7 +44,7 @@ func ModelTTS( filePath := filepath.Join(appConfig.AudioDir, fileName) // We join the model name to the model path here. This seems to only be done for TTS and is HIGHLY suspect. - // Copying it over nearly verbatem to try and restore broken code. + // Copying it over nearly verbatim to try and restore broken code. modelPath := "" // Checking first that it exists and is not outside ModelPath // TODO: we should actually first check if the modelFile is looking like diff --git a/core/config/backend_config_loader.go b/core/config/backend_config_loader.go index 5fff905af313..d97e90d3c66e 100644 --- a/core/config/backend_config_loader.go +++ b/core/config/backend_config_loader.go @@ -81,10 +81,10 @@ func readMultipleBackendConfigsFromFile(file string, opts ...ConfigLoaderOption) c := &[]*BackendConfig{} f, err := os.ReadFile(file) if err != nil { - return nil, fmt.Errorf("cannot read config file: %w", err) + return nil, fmt.Errorf("readMultipleBackendConfigsFromFile cannot read config file %q: %w", file, err) } if err := yaml.Unmarshal(f, c); err != nil { - return nil, fmt.Errorf("cannot unmarshal config file: %w", err) + return nil, fmt.Errorf("readMultipleBackendConfigsFromFile cannot unmarshal config file %q: %w", file, err) } for _, cc := range *c { @@ -101,10 +101,10 @@ func readBackendConfigFromFile(file string, opts ...ConfigLoaderOption) (*Backen c := &BackendConfig{} f, err := os.ReadFile(file) if err != nil { - return nil, fmt.Errorf("cannot read config file: %w", err) + return nil, fmt.Errorf("readBackendConfigFromFile cannot read config file %q: %w", file, err) } if err := yaml.Unmarshal(f, c); err != nil { - return nil, fmt.Errorf("cannot unmarshal config file: %w", err) + return nil, fmt.Errorf("readBackendConfigFromFile cannot unmarshal config file %q: %w", file, err) } c.SetDefaults(opts...) @@ -178,7 +178,7 @@ func (bcl *BackendConfigLoader) LoadBackendConfig(file string, opts ...ConfigLoa defer bcl.Unlock() c, err := readBackendConfigFromFile(file, opts...) if err != nil { - return fmt.Errorf("cannot read config file: %w", err) + return fmt.Errorf("LoadBackendConfig cannot read config file %q: %w", file, err) } if c.Validate() { @@ -338,7 +338,7 @@ func (bcl *BackendConfigLoader) LoadBackendConfigsFromPath(path string, opts ... entries, err := os.ReadDir(path) if err != nil { - return fmt.Errorf("cannot read directory '%s': %w", path, err) + return fmt.Errorf("LoadBackendConfigsFromPath cannot read directory '%s': %w", path, err) } files := make([]fs.FileInfo, 0, len(entries)) for _, entry := range entries { @@ -356,13 +356,13 @@ func (bcl *BackendConfigLoader) LoadBackendConfigsFromPath(path string, opts ... } c, err := readBackendConfigFromFile(filepath.Join(path, file.Name()), opts...) if err != nil { - log.Error().Err(err).Msgf("cannot read config file: %s", file.Name()) + log.Error().Err(err).Str("File Name", file.Name()).Msgf("LoadBackendConfigsFromPath cannot read config file") continue } if c.Validate() { bcl.configs[c.Name] = *c } else { - log.Error().Err(err).Msgf("config is not valid") + log.Error().Err(err).Str("Name", c.Name).Msgf("config is not valid") } }