From 8b4204c9ca448a73295437b00d3d39114d2dbc48 Mon Sep 17 00:00:00 2001 From: Daniel Fox Date: Fri, 8 Sep 2023 13:45:37 -0700 Subject: [PATCH] Add error handling/messaging to `GetLatestRelease` --- ghr.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ghr.go b/ghr.go index 2c488e0..f9dd9fc 100644 --- a/ghr.go +++ b/ghr.go @@ -77,6 +77,9 @@ func (g *GHR) CreateRelease(ctx context.Context, req *github.RepositoryRelease, func (g *GHR) GetLatestRelease(ctx context.Context) (*github.RepositoryRelease, error) { release, err := g.GitHub.GetLatestRelease(ctx) + if err != nil { + return nil, fmt.Errorf("Unable to fetch latest Github release: %w", err) + } return release, err }