mirror of
https://github.com/DNSCrypt/dnscrypt-proxy.git
synced 2024-12-29 00:30:30 +01:00
change: xtransport: Return http response status string as error, do name make own string
This gives much better possibilities to diagnose problems than error message with only "informative" part being 500.
This commit is contained in:
parent
72681725b1
commit
df03065eaf
@ -272,7 +272,7 @@ func (xTransport *XTransport) Fetch(method string, url *url.URL, accept string,
|
||||
if resp == nil {
|
||||
err = errors.New("Webserver returned an error")
|
||||
} else if resp.StatusCode < 200 || resp.StatusCode > 299 {
|
||||
err = fmt.Errorf("Webserver returned code %d", resp.StatusCode)
|
||||
err = errors.New(resp.Status)
|
||||
}
|
||||
} else {
|
||||
(*xTransport.transport).CloseIdleConnections()
|
||||
|
Loading…
Reference in New Issue
Block a user