summaryrefslogtreecommitdiff
path: root/pkg/vpn
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2021-11-12 20:19:31 +0100
committerkali kaneko (leap communications) <kali@leap.se>2021-11-23 21:51:25 +0100
commitd4313f27aafa7ecce211bbcd12a6e5cf9ebe3609 (patch)
treebd406373cab766267f7ee6d54c4bef13089464f1 /pkg/vpn
parentb15c31bdf47c2db5d95049090a5fd099ae1c1e02 (diff)
[debug] more verbose logs about failure
Diffstat (limited to 'pkg/vpn')
-rw-r--r--pkg/vpn/bonafide/eip_service.go8
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)
}
}