diff options
author | kali kaneko (leap communications) <kali@leap.se> | 2021-11-12 20:19:31 +0100 |
---|---|---|
committer | kali kaneko (leap communications) <kali@leap.se> | 2021-11-23 21:51:25 +0100 |
commit | d4313f27aafa7ecce211bbcd12a6e5cf9ebe3609 (patch) | |
tree | bd406373cab766267f7ee6d54c4bef13089464f1 /pkg/vpn | |
parent | b15c31bdf47c2db5d95049090a5fd099ae1c1e02 (diff) |
[debug] more verbose logs about failure
Diffstat (limited to 'pkg/vpn')
-rw-r--r-- | pkg/vpn/bonafide/eip_service.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/pkg/vpn/bonafide/eip_service.go b/pkg/vpn/bonafide/eip_service.go index c106135..28d0479 100644 --- a/pkg/vpn/bonafide/eip_service.go +++ b/pkg/vpn/bonafide/eip_service.go @@ -5,6 +5,7 @@ import ( "fmt" "io" "log" + "os" "strings" "time" @@ -80,14 +81,19 @@ func (b *Bonafide) fetchEipJSON() error { resp, err := b.client.Post(eip3API, "", nil) for err != nil { resp, err = b.client.Post(eip3API, "", nil) + if err != nil { + log.Println("Error fetching eip v3 json:" + eip3API) + if os.Getenv("DEBUG") == "1" { + log.Println(err) + } // TODO it might be that we get no error, but an empty file or whatever done // by DNS poisoning. Should try to parse the file. uri := b.getURLNoDNS("eip") resp, err = b.client.Post(uri, "", nil) } if err != nil { - log.Printf("Error fetching eip v3 json: %v", err) + log.Printf("Error again fetching eip v3 json: %v", err) time.Sleep(retryFetchJSONSeconds * time.Second) } } |