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

fix(windows): Make sure to log the final error message #15346

Merged
merged 1 commit into from
May 15, 2024
Merged
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
8 changes: 6 additions & 2 deletions cmd/telegraf/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,11 @@ func runApp(args []string, outputBuffer io.Writer, pprof Server, c TelegrafConfi
defer memguard.Purge()
defer logger.CloseLogging()

return app.Run(args)
if err := app.Run(args); err != nil {
log.Printf("E! %s", err)
return err
}
return nil
}

func main() {
Expand All @@ -385,6 +389,6 @@ func main() {
pprof := NewPprofServer()
c := config.NewConfig()
if err := runApp(os.Args, os.Stdout, pprof, c, &agent); err != nil {
log.Fatalf("E! %s", err)
os.Exit(1)
}
}
Loading