summaryrefslogtreecommitdiffstats
path: root/gdb-xds.go
diff options
context:
space:
mode:
Diffstat (limited to 'gdb-xds.go')
-rw-r--r--gdb-xds.go14
1 files changed, 11 insertions, 3 deletions
diff --git a/gdb-xds.go b/gdb-xds.go
index d57817d..0e93b52 100644
--- a/gdb-xds.go
+++ b/gdb-xds.go
@@ -120,14 +120,22 @@ func (g *GdbXds) Init() (int, error) {
HeaderClientKeyName: "Xds-Agent-Sid",
CsrfDisable: true,
LogOut: g.log.Out,
- LogLevel: common.HTTPLogLevelWarning,
+ LogPrefix: "XDSAGENT: ",
+ LogLevel: common.HTTPLogLevelDebug,
}
c, err := common.HTTPNewClient(baseURL, conf)
if err != nil {
errmsg := err.Error()
- if m, err := regexp.MatchString("Get http.?://", errmsg); m && err == nil {
+ m, err := regexp.MatchString("Get http.?://", errmsg)
+ if (m && err == nil) || strings.Contains(errmsg, "Failed to get device ID") {
i := strings.LastIndex(errmsg, ":")
- errmsg = "Cannot connection to " + baseURL + errmsg[i:]
+ newErr := "Cannot connection to " + baseURL
+ if i > 0 {
+ newErr += " (" + strings.TrimSpace(errmsg[i+1:]) + ")"
+ } else {
+ newErr += " (" + strings.TrimSpace(errmsg) + ")"
+ }
+ errmsg = newErr
}
return int(syscallEBADE), fmt.Errorf(errmsg)
}