Skip to content

Commit 3d6b56a

Browse files
committed
chore: improve error message
1 parent 9d28bfe commit 3d6b56a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/config/loader.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ func (l *Loader) parseConfig() error {
185185
// Load configuration from flags only.
186186
err = l.viper.Unmarshal(l.cfg)
187187
if err != nil {
188-
return err
188+
return fmt.Errorf("can't unmarshal config by viper (flags): %w", err)
189189
}
190190

191191
return nil
@@ -201,7 +201,7 @@ func (l *Loader) parseConfig() error {
201201

202202
// Load configuration from all sources (flags, file).
203203
if err := l.viper.Unmarshal(l.cfg, fileDecoderHook()); err != nil {
204-
return fmt.Errorf("can't unmarshal config by viper: %w", err)
204+
return fmt.Errorf("can't unmarshal config by viper (flags, file): %w", err)
205205
}
206206

207207
if l.cfg.InternalTest { // just for testing purposes: to detect config file usage

0 commit comments

Comments
 (0)