From 071c6e4a031a754fe771af68c21e8ef10ebf863c Mon Sep 17 00:00:00 2001 From: Sebas Risco Date: Wed, 30 Mar 2022 11:23:42 +0200 Subject: [PATCH] Add error message when a service is not ready in svc run command --- pkg/cluster/cluster.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/cluster/cluster.go b/pkg/cluster/cluster.go index 4fbb6c7..1cdf621 100644 --- a/pkg/cluster/cluster.go +++ b/pkg/cluster/cluster.go @@ -123,6 +123,9 @@ func CheckStatusCode(res *http.Response) error { if res.StatusCode == 404 { return errors.New("not found") } + if res.StatusCode == 502 { + return errors.New("the service is not ready yet, please wait until it's ready or check the if something failed") + } // Create an error from the failed response body body, err := ioutil.ReadAll(res.Body) if err != nil {