Skip to content

Commit

Permalink
Verbose "not found version patterns" error (#184)
Browse files Browse the repository at this point in the history
Current "not found version patterns" does not provide any clue about what response payload it is trying to parse.

I'd like it to throw some light about the parsing failure.
  • Loading branch information
varas committed Jul 16, 2022
1 parent 08071c0 commit d8c63cb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/utils/fetch.go
Expand Up @@ -2,7 +2,6 @@ package utils

import (
"context"
"errors"
"fmt"
"net/http"
"regexp"
Expand Down Expand Up @@ -53,5 +52,5 @@ func FetchLatestVersion(ctx context.Context) (version string, err error) {
if versionMatched := versionPattern.FindString(*body); versionMatched != "" {
return versionMatched, nil
}
return "", errors.New("not found version patterns")
return "", fmt.Errorf("not found version patterns parsing GH response: %s", string(body))
}

0 comments on commit d8c63cb

Please sign in to comment.