Skip to content

Commit

Permalink
🥅 Catch error from request
Browse files Browse the repository at this point in the history
  • Loading branch information
CryogenicPlanet committed Nov 5, 2021
1 parent c2935be commit 0fab50a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,19 @@ func makePrComment(deployUrl string) {

if resp.StatusCode > 300 {
fmt.Println("Failed response", resp.Status, resp)
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
fmt.Println("[Error]", err)
}

fmt.Println("Failed to comment on PR :(", owner, repo, issue)

panic(string(body))
}

}

fmt.Println("Commented on PR!")
fmt.Println("Commented on PR!", owner, repo, issue)

}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "depp-installer",
"version": "0.0.8-ci-env",
"version": "0.0.8-ci-error-handling",
"description": " A fast unused and duplicate dependency checker ",
"repository": {
"type": "git",
Expand Down

0 comments on commit 0fab50a

Please sign in to comment.