aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFChannel <=>2021-01-17 15:14:50 -0800
committerFChannel <=>2021-01-17 15:14:50 -0800
commit89f88072c9ffd6a6e321ee7b5455665d82dbd6d7 (patch)
tree48e9ea5bdad204db1203b159901659eaa32d3dca
parent12e33aff151dd4a9c03e9836ea7ac971b9928090 (diff)
less verbose error when not being able to connect to a remote instance
-rw-r--r--main.go13
1 files changed, 6 insertions, 7 deletions
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")