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