Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly wraps errors instead of wrapping error strings #4076

Merged
merged 1 commit into from
Sep 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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