Skip to content

Commit

Permalink
fix: print concrete error from fillPlugin in logs (#5346)
Browse files Browse the repository at this point in the history
* fix: print concrete error from fillPlugin in logs

* Use `WithError`

Co-authored-by: Grzegorz Burzyński <[email protected]>

---------

Co-authored-by: Grzegorz Burzyński <[email protected]>
  • Loading branch information
randmonkey and czeslavo authored Dec 15, 2023
1 parent d1a3a81 commit 622c990
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/dataplane/deckgen/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func ToDeckContent(
}
err = fillPlugin(ctx, &plugin, params.PluginSchemas)
if err != nil {
log.Errorf("failed to fill-in defaults for plugin: %s", *plugin.Name)
log.WithError(err).Errorf("failed to fill-in defaults for plugin: %s", *plugin.Name)
}
service.Plugins = append(service.Plugins, &plugin)
sort.SliceStable(service.Plugins, func(i, j int) bool {
Expand All @@ -71,7 +71,7 @@ func ToDeckContent(
}
err = fillPlugin(ctx, &plugin, params.PluginSchemas)
if err != nil {
log.Errorf("failed to fill-in defaults for plugin: %s", *plugin.Name)
log.WithError(err).Errorf("failed to fill-in defaults for plugin: %s", *plugin.Name)
}
route.Plugins = append(route.Plugins, &plugin)
sort.SliceStable(route.Plugins, func(i, j int) bool {
Expand All @@ -95,7 +95,7 @@ func ToDeckContent(
}
err = fillPlugin(ctx, &plugin, params.PluginSchemas)
if err != nil {
log.Errorf("failed to fill-in defaults for plugin: %s", *plugin.Name)
log.WithError(err).Errorf("failed to fill-in defaults for plugin: %s", *plugin.Name)
}
content.Plugins = append(content.Plugins, plugin)
}
Expand Down

0 comments on commit 622c990

Please sign in to comment.