wrap errors correctly

This commit is contained in:
2026-07-07 09:34:36 +02:00
parent 24038e36f7
commit 2f77c27715
22 changed files with 95 additions and 94 deletions

View File

@@ -58,7 +58,7 @@ func CcrStatus(conf *cfg.Config, leader, follower string) error {
res, err := conf.Clusters[alias].ES().Cat.Indices().
Do(context.Background())
if err != nil {
return fmt.Errorf("failed to get indicies on %s: %s", alias, esErrorString(err))
return fmt.Errorf("failed to get indicies on %s: %w", alias, esErrorString(err))
}
indices[alias] = make(map[string]*types.IndicesRecord, len(res))
@@ -87,7 +87,7 @@ func CcrRemoteInfo(conf *cfg.Config, index string) error {
res, err := conf.DefaultCluster.ES().Cluster.RemoteInfo().
Do(context.Background())
if err != nil {
return fmt.Errorf("failed to retrieve follower info: %s", esErrorString(err))
return fmt.Errorf("failed to retrieve follower info: %w", esErrorString(err))
}
slog.Debug("ccr remote info", "info", res)