Update 'lib.go'
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"io"
|
||||
"net/http"
|
||||
"strings"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type Cli struct {
|
||||
@@ -57,7 +58,7 @@ func (c *Cli) Do(method string, strurl string, body []byte) (*http.Response, err
|
||||
}
|
||||
res,err:= c.cli.Do(req)
|
||||
if err==nil && res.StatusCode >=400{
|
||||
return nil, errors.New("Http return code - %d: %s",res.StatusCode,res.Status)
|
||||
return nil, errors.New(fmt.Sprintf("Http return code - %d: %s",res.StatusCode,res.Status))
|
||||
}
|
||||
return res,err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user