handleStartupError provides user-friendly error messages for startup failures.
(err error, cfg *config.Config)
| 552 | |
| 553 | // handleStartupError provides user-friendly error messages for startup failures. |
| 554 | func handleStartupError(err error, cfg *config.Config) error { |
| 555 | fmt.Println(display.IconText("❌", err.Error(), cfg.ShowIcons)) |
| 556 | fmt.Println() |
| 557 | |
| 558 | if strings.Contains(err.Error(), "authentication failed") { |
| 559 | fmt.Println(display.IconText("💡", "Please check your credentials in the config file:", cfg.ShowIcons)) |
| 560 | fmt.Printf(" %s\n", config.GetDefaultConfigPath()) |
| 561 | } else if strings.Contains(err.Error(), "connection") || strings.Contains(err.Error(), "timeout") { |
| 562 | fmt.Println(display.IconText("💡", "Please check your Proxmox server address and network connectivity:", cfg.ShowIcons)) |
| 563 | fmt.Printf(" Current address: %s\n", cfg.Addr) |
| 564 | } |
| 565 | |
| 566 | return err |
| 567 | } |
| 568 | |
| 569 | // printVersion prints version information. |
| 570 | func printVersion() { |
no test coverage detected