MCPcopy Index your code
hub / github.com/TruthHun/BookStack / HandleResponse

Function HandleResponse

utils/util.go:774–783  ·  view source on GitHub ↗

处理http响应成败

(resp *http.Response, err error)

Source from the content-addressed store, hash-verified

772
773// 处理http响应成败
774func HandleResponse(resp *http.Response, err error) error {
775 if err == nil {
776 defer resp.Body.Close()
777 if resp.StatusCode >= 300 || resp.StatusCode < 200 {
778 b, _ := ioutil.ReadAll(resp.Body)
779 err = errors.New(resp.Status + ";" + string(b))
780 }
781 }
782 return err
783}
784
785// 下载图片
786func DownImage(src string, headers ...map[string]string) (filename string, err error) {

Callers 8

InitMethod · 0.92
BuildIndexByBuckMethod · 0.92
SetBookPublicMethod · 0.92
BuildIndexMethod · 0.92
DeleteIndexMethod · 0.92
pingMethod · 0.92
existIndexMethod · 0.92
createIndexMethod · 0.92

Calls 1

stringFunction · 0.85

Tested by

no test coverage detected