From f1c93a02ae89e144cc91cb481568fd2ffb258821 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malte=20M=C3=BCnch?= Date: Tue, 28 Mar 2023 18:31:50 +0200 Subject: [PATCH] Improves error handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Malte Münch --- pkg/releaser/importer.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/releaser/importer.go b/pkg/releaser/importer.go index 1c3e488..13a45b4 100644 --- a/pkg/releaser/importer.go +++ b/pkg/releaser/importer.go @@ -212,8 +212,16 @@ func ensureChart(c *chart.Chart, cfg SrcConfiguration) { func writeReleaseNotes(cfg SrcConfiguration, client *github.Client) *chart.File { rr, _, err := client.Repositories.GetReleaseByTag(context.Background(), strings.Split(cfg.Repo, "/")[0], strings.Split(cfg.Repo, "/")[1], cfg.Version) if err != nil { + if strings.Contains(err.Error(), "Bad credentials") { + logrus.Error(err) + os.Exit(1) + } logrus.Error(err) } + if rr == nil { + logrus.Error("Error: Received empty GitHub Release for ", cfg.Repo) + os.Exit(1) + } file := &chart.File{ Name: "RELEASE.md",