Added error handling if SCG returns non-200 HTTP status code

This commit is contained in:
flygrounder 2020-02-27 10:41:03 +03:00
parent d422f63f9c
commit 33ba48c968
3 changed files with 26 additions and 5 deletions

View file

@ -37,7 +37,9 @@ func GetCardByUrl(path string) string {
if err != nil {
return ""
}
defer response.Body.Close()
defer func() {
_ = response.Body.Close()
}()
data, err := ioutil.ReadAll(response.Body)
if err != nil {
return ""