From 0fab50a86a7447136c2b8a972e2a13ef2e15f1eb Mon Sep 17 00:00:00 2001 From: Rahul Tarak Date: Fri, 5 Nov 2021 11:32:17 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=A5=85=20Catch=20error=20from=20request?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ci.go | 10 +++++++++- package.json | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ci.go b/ci.go index 6ae89e8..8effaf1 100644 --- a/ci.go +++ b/ci.go @@ -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) } diff --git a/package.json b/package.json index 0b44206..9cf73a1 100644 --- a/package.json +++ b/package.json @@ -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",