mirror of
https://github.com/syncthing/syncthing.git
synced 2024-11-17 02:48:57 -07:00
Merge pull request #26 from canton7/feature/better-logging
Add more logging in the case of relaypoolsrv internal server error
This commit is contained in:
commit
c7d51a26f6
@ -28,17 +28,13 @@ func poolHandler(pool string, uri *url.URL) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println("Error joining pool", pool, err)
|
log.Println("Error joining pool", pool, err)
|
||||||
} else if resp.StatusCode == 500 {
|
} else if resp.StatusCode == 500 {
|
||||||
if debug {
|
bs, err := ioutil.ReadAll(resp.Body)
|
||||||
bs, err := ioutil.ReadAll(resp.Body)
|
if err != nil {
|
||||||
if err != nil {
|
log.Println("Failed to join", pool, "due to an internal server error. Could not read response:", err)
|
||||||
log.Println("Failed to read response body for", pool, err)
|
|
||||||
} else {
|
|
||||||
log.Println("Response for", pool, string(bs))
|
|
||||||
}
|
|
||||||
resp.Body.Close()
|
|
||||||
} else {
|
} else {
|
||||||
log.Println(pool, "failed to join due to an internal server error")
|
log.Println("Failed to join", pool, "due to an internal server error:", string(bs))
|
||||||
}
|
}
|
||||||
|
resp.Body.Close()
|
||||||
} else if resp.StatusCode == 429 {
|
} else if resp.StatusCode == 429 {
|
||||||
log.Println(pool, "under load, will retry in a minute")
|
log.Println(pool, "under load, will retry in a minute")
|
||||||
time.Sleep(time.Minute)
|
time.Sleep(time.Minute)
|
||||||
|
Loading…
Reference in New Issue
Block a user