mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-20 03:51:00 +00: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 {
|
||||
log.Println("Error joining pool", pool, err)
|
||||
} else if resp.StatusCode == 500 {
|
||||
if debug {
|
||||
bs, err := ioutil.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
log.Println("Failed to read response body for", pool, err)
|
||||
} else {
|
||||
log.Println("Response for", pool, string(bs))
|
||||
}
|
||||
resp.Body.Close()
|
||||
bs, err := ioutil.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
log.Println("Failed to join", pool, "due to an internal server error. Could not read response:", err)
|
||||
} 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 {
|
||||
log.Println(pool, "under load, will retry in a minute")
|
||||
time.Sleep(time.Minute)
|
||||
|
Loading…
Reference in New Issue
Block a user