Refactor error messages in main.go for better clarity and instructions

This commit is contained in:
Simon Larsen
2024-05-14 10:05:54 +01:00
parent db32292d33
commit dcc9d4fdf2

View File

@@ -143,7 +143,7 @@ func main() {
case "run":
err := prg.config.loadConfig()
if os.IsNotExist(err) {
slog.Error("Service configuration not found. Please install the service properly.")
slog.Error("Service configuration not found. Please run 'oneuptime-infrastructure-agent install' to install the service.")
os.Exit(2)
}
if err != nil {
@@ -151,7 +151,7 @@ func main() {
os.Exit(2)
}
if err != nil || prg.config.SecretKey == "" || prg.config.OneUptimeURL == "" {
slog.Error("Service configuration not found or is incomplete. Please install the service properly.")
slog.Error("Service configuration not found or is incomplete. Please run 'oneuptime-infrastructure-agent install' to install the service.")
os.Exit(2)
}
err = s.Run()