diff --git a/banchoCrawler/osuApi.go b/banchoCrawler/osuApi.go index 0d8f47f..069b5de 100644 --- a/banchoCrawler/osuApi.go +++ b/banchoCrawler/osuApi.go @@ -11,6 +11,8 @@ import ( "net/http" "strings" "time" + "github.com/pkg/errors" + "fmt" ) type banchoJWT struct { @@ -144,5 +146,8 @@ func login(refresh bool) (err error) { return } + if res.StatusCode != 200 { + return errors.New(fmt.Sprint(res.StatusCode, string(body))) + } return json.Unmarshal(body, &config.Config.Osu.Token) }