Skip to content

Commit

Permalink
Improves error handling
Browse files Browse the repository at this point in the history
Signed-off-by: Malte Münch <[email protected]>
  • Loading branch information
mxmxchere committed Mar 28, 2023
1 parent 999a356 commit f1c93a0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/releaser/importer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit f1c93a0

Please sign in to comment.