From ed90275045e30c9aef6853def5d2c877673a5132 Mon Sep 17 00:00:00 2001 From: lyx0 Date: Sun, 17 Oct 2021 19:31:54 +0200 Subject: [PATCH] dont crash fatally --- pkg/api/ivr/followage.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/api/ivr/followage.go b/pkg/api/ivr/followage.go index e237f26..2ab1ea9 100644 --- a/pkg/api/ivr/followage.go +++ b/pkg/api/ivr/followage.go @@ -4,8 +4,9 @@ import ( "encoding/json" "fmt" "io/ioutil" - "log" "net/http" + + log "github.com/sirupsen/logrus" ) // https://api.ivr.fi @@ -21,14 +22,14 @@ type followageApiResponse struct { func Followage(streamer string, username string) (string, error) { resp, err := http.Get(fmt.Sprintf("https://api.ivr.fi/twitch/subage/%s/%s", username, streamer)) if err != nil { - log.Fatalln(err) + log.Error(err) } defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body) if err != nil { - log.Fatalln(err) + log.Error(err) } var responseObject followageApiResponse