From 89f88072c9ffd6a6e321ee7b5455665d82dbd6d7 Mon Sep 17 00:00:00 2001 From: FChannel <=> Date: Sun, 17 Jan 2021 15:14:50 -0800 Subject: less verbose error when not being able to connect to a remote instance --- main.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index a1f55d8..1146c51 100644 --- a/main.go +++ b/main.go @@ -390,13 +390,9 @@ func CreateTripCode(input string) string { } func CreateNameTripCode(input string) string { - fmt.Println("AHHHHHHHHHH") re := regexp.MustCompile("#.+") chunck := re.FindString(input) - fmt.Println(input) - fmt.Println(chunck) hash := CreateTripCode(chunck) - fmt.Println(hash[0:8]) return re.ReplaceAllString(input, hash[0:8]) } @@ -933,20 +929,23 @@ func MakeActivityRequest(activity Activity) { } func GetCollectionFromID(id string) Collection { + var nColl Collection + req, err := http.NewRequest("GET", id, nil) CheckError(err, "could not get collection from id req") resp, err := http.DefaultClient.Do(req) - CheckError(err, "could not get collection from id resp") + if err != nil { + fmt.Println("could not get collection from " + id) + return nColl + } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) - var nColl Collection - err = json.Unmarshal(body, &nColl) CheckError(err, "error getting collection resp from json body") -- cgit v1.2.3