Added status code check
This commit is contained in:
parent
4381e9c8c2
commit
bbddab9722
@ -2,6 +2,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"net/http"
|
||||||
"sort"
|
"sort"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -52,6 +53,11 @@ func download(characterID string) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if response.StatusCode() != http.StatusOK {
|
||||||
|
color.Red("Status: %d", response.StatusCode())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
err = character.SetImageBytes(response.Bytes())
|
err = character.SetImageBytes(response.Bytes())
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user