Skip to content

Commit a042652

Browse files
authored
Merge pull request #4686 from kersten/chore/normalize-error-handling-in-config-v3
🌱 (chore): normalize error messages and wrap errors using %w
2 parents d3cc7d1 + 8b85fbb commit a042652

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/config/v3/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,11 +318,11 @@ func (c *Cfg) EncodePluginConfig(key string, configObj interface{}) error {
318318
// Get object's bytes and set them under key in extra fields.
319319
b, err := yaml.Marshal(configObj)
320320
if err != nil {
321-
return fmt.Errorf("failed to convert %T object to bytes: %s", configObj, err)
321+
return fmt.Errorf("failed to convert %T object to bytes: %w", configObj, err)
322322
}
323323
var fields map[string]interface{}
324324
if err := yaml.Unmarshal(b, &fields); err != nil {
325-
return fmt.Errorf("failed to unmarshal %T object bytes: %s", configObj, err)
325+
return fmt.Errorf("failed to unmarshal %T object bytes: %w", configObj, err)
326326
}
327327
if c.Plugins == nil {
328328
c.Plugins = make(map[string]pluginConfig)

0 commit comments

Comments
 (0)