Added status code check

This commit is contained in:
Eduard Urbach 2018-04-11 15:34:06 +02:00
parent 4381e9c8c2
commit bbddab9722

View File

@ -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 {