replace log.Fatalln with log.Error

This commit is contained in:
lyx0 2021-10-17 23:02:55 +02:00
parent 719213b25e
commit 21ee59eb7e
3 changed files with 6 additions and 6 deletions

View file

@ -31,7 +31,7 @@ func FirstLine(streamer string, username string) (string, error) {
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
log.Fatalln(err)
log.Error(err)
}
var responseObject firstLineApiResponse

View file

@ -45,7 +45,7 @@ func Subage(username string, streamer string) (string, error) {
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
log.Fatalln(err)
log.Error(err)
}
var responseObject subageApiResponse

View file

@ -11,11 +11,11 @@ import (
func RandomNumber() string {
response, err := http.Get("http://numbersapi.com/random/trivia")
if err != nil {
log.Fatalln(err)
log.Error(err)
}
responseData, err := ioutil.ReadAll(response.Body)
if err != nil {
log.Fatalln(err)
log.Error(err)
}
return string(responseData)
@ -24,11 +24,11 @@ func RandomNumber() string {
func Number(number string) string {
response, err := http.Get(fmt.Sprint("http://numbersapi.com/" + string(number)))
if err != nil {
log.Fatalln(err)
log.Error(err)
}
responseData, err := ioutil.ReadAll(response.Body)
if err != nil {
log.Fatalln(err)
log.Error(err)
}
return string(responseData)
}