MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / handleStartupError

Function handleStartupError

internal/bootstrap/bootstrap.go:554–567  ·  view source on GitHub ↗

handleStartupError provides user-friendly error messages for startup failures.

(err error, cfg *config.Config)

Source from the content-addressed store, hash-verified

552
553// handleStartupError provides user-friendly error messages for startup failures.
554func 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.
570func printVersion() {

Callers 1

StartApplicationFunction · 0.85

Calls 3

IconTextFunction · 0.92
GetDefaultConfigPathFunction · 0.92
ErrorMethod · 0.65

Tested by

no test coverage detected