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

[Winlogbeat] Improve registry error message #30543

Merged
merged 1 commit into from
Feb 22, 2022
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: 2 additions & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...main[Check the HEAD dif

*Winlogbeat*

- Improve the error message when the registry file content is invalid. {pull}30543[30543]


*Elastic Log Driver*

Expand Down
2 changes: 1 addition & 1 deletion winlogbeat/beater/winlogbeat.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func (eb *Winlogbeat) setup(b *beat.Beat) error {
var err error
eb.checkpoint, err = checkpoint.NewCheckpoint(config.RegistryFile, config.RegistryFlush)
if err != nil {
return err
return fmt.Errorf("failed to initialize checkpoint registry: %w", err)
}

eb.pipeline = b.Publisher
Expand Down
2 changes: 1 addition & 1 deletion winlogbeat/checkpoint/checkpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ func (c *Checkpoint) read() (*PersistedState, error) {
ps := &PersistedState{}
err = yaml.Unmarshal(contents, ps)
if err != nil {
return nil, err
return nil, fmt.Errorf("failed to read persisted state: %w", err)
}

return ps, nil
Expand Down