Skip to content

Commit

Permalink
Correctly wraps errors instead of wrapping error strings (#4076)
Browse files Browse the repository at this point in the history
Signed-off-by: Bogdan Drutu <[email protected]>
  • Loading branch information
bogdandrutu authored Sep 20, 2021
1 parent 1f5dd9f commit 37f476a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion service/internal/builder/exporters_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ func buildExporter(
// Could not create because this exporter does not support this data type.
return nil, exporterTypeMismatchErr(cfg, requirement.requiredBy, dataType)
}
return nil, fmt.Errorf("error creating %v exporter: %v", cfg.ID(), err)
return nil, fmt.Errorf("error creating %v exporter: %w", cfg.ID(), err)
}

// Check if the factory really created the exporter.
Expand Down
2 changes: 1 addition & 1 deletion service/internal/builder/pipelines_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ func (pb *pipelinesBuilder) buildPipeline(ctx context.Context, pipelineCfg *conf
}

if err != nil {
return nil, fmt.Errorf("error creating processor %q in pipeline %q: %v",
return nil, fmt.Errorf("error creating processor %q in pipeline %q: %w",
procID, pipelineCfg.Name, err)
}

Expand Down
2 changes: 1 addition & 1 deletion service/parserprovider/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (fl *fileProvider) Get(context.Context) (*configparser.ConfigMap, error) {

cp, err := configparser.NewConfigMapFromFile(fileName)
if err != nil {
return nil, fmt.Errorf("error loading config file %q: %v", fileName, err)
return nil, fmt.Errorf("error loading config file %q: %w", fileName, err)
}

return cp, nil
Expand Down

0 comments on commit 37f476a

Please sign in to comment.