mirror of
https://github.com/matrix-org/matrix-spec
synced 2025-12-20 16:38:37 +01:00
Merge pull request #44 from matrix-org/speculator-errs
speculator: Don't ignore errors
This commit is contained in:
commit
e4f4670260
|
|
@ -67,13 +67,18 @@ func gitCheckout(path, sha string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func lookupPullRequest(prNumber string) (PullRequest, error) {
|
func lookupPullRequest(prNumber string) (*PullRequest, error) {
|
||||||
resp, _ := http.Get("https://api.github.com/repos/matrix-org/matrix-doc/pulls/" + prNumber)
|
resp, err := http.Get("https://api.github.com/repos/matrix-org/matrix-doc/pulls/" + prNumber)
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("error getting pulls: %v", err)
|
||||||
|
}
|
||||||
dec := json.NewDecoder(resp.Body)
|
dec := json.NewDecoder(resp.Body)
|
||||||
var pr PullRequest
|
var pr PullRequest
|
||||||
_ = dec.Decode(&pr)
|
if err := dec.Decode(&pr); err != nil {
|
||||||
return pr, nil
|
return nil, fmt.Errorf("error decoding pulls: %v", err)
|
||||||
|
}
|
||||||
|
return &pr, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func generate(dir string) error {
|
func generate(dir string) error {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue