Added error handling if SCG returns non-200 HTTP status code
This commit is contained in:
parent
d422f63f9c
commit
33ba48c968
3 changed files with 26 additions and 5 deletions
|
|
@ -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 ""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue