diff --git a/cmd/get.go b/cmd/get.go index 57533a0..94d44db 100644 --- a/cmd/get.go +++ b/cmd/get.go @@ -45,7 +45,9 @@ var getCmd = &cobra.Command{ pm.Add(uri) } - pm.Update() + if err := pm.Update(); err != nil { + log.Fatal("Could not update pool.", err) + } switch output { case "json": diff --git a/cmd/server.go b/cmd/server.go index 3146a34..4aa851e 100644 --- a/cmd/server.go +++ b/cmd/server.go @@ -103,7 +103,9 @@ to quickly create a Cobra application.`, defer cancel() // Doesn't block if no connections, but will otherwise wait // until the timeout deadline. - srv.Shutdown(ctx) + if err := srv.Shutdown(ctx); err != nil { + log.Fatal("Error during shutdown", err) + } // Optionally, you could run srv.Shutdown in a goroutine and block on // <-ctx.Done() if your application should wait for other services // to finalize based on context cancellation. @@ -136,7 +138,9 @@ func init() { flag := serverCmd.Flags().Lookup(flag) flag.Usage = fmt.Sprintf("%v [env %v]", flag.Usage, env) if value := os.Getenv(env); value != "" { - flag.Value.Set(value) + if err := flag.Value.Set(value); err != nil { + log.Error(err) + } } } } diff --git a/main.go b/main.go index 8fffe69..bb05034 100644 --- a/main.go +++ b/main.go @@ -15,6 +15,7 @@ package main import ( "fmt" + "github.com/hipages/php-fpm_exporter/cmd" )