Improved and fixed connection to XDS Server
[src/xds/xds-agent.git] / lib / agent / apiv1-version.go
index c75e7f5..c73010e 100644 (file)
@@ -1,11 +1,11 @@
 package agent
 
 import (
+       "fmt"
        "net/http"
 
        "github.com/gin-gonic/gin"
        "github.com/iotbzh/xds-agent/lib/apiv1"
-       common "github.com/iotbzh/xds-common/golib"
 )
 
 // getInfo : return various information about server
@@ -23,8 +23,10 @@ func (s *APIService) getVersion(c *gin.Context) {
        for _, svr := range s.xdsServers {
                res := apiv1.VersionData{}
                if err := svr.GetVersion(&res); err != nil {
-                       common.APIError(c, "Cannot retrieve version of XDS server ID %s : %v", svr.ID, err.Error())
-                       return
+                       errMsg := fmt.Sprintf("Cannot retrieve version of XDS server ID %s : %v", svr.ID, err.Error())
+                       s.Log.Warning(errMsg)
+                       res.ID = svr.ID
+                       res.Version = errMsg
                }
                svrVer = append(svrVer, res)
        }