summaryrefslogtreecommitdiff
path: root/bilibili/util.go
blob: 1267a39fe5e99ca87286ee6d53a47aa275f2ce2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
package bilibili

import (
	"fmt"
	"net/http"
)

func validateHttpStatus(r *http.Response) (err error) {
	if code := r.StatusCode; code != http.StatusOK {
		err = fmt.Errorf("unsuccessful HTTP status on API %v: %v", r.Request.URL, code)
	}
	return
}