aboutsummaryrefslogtreecommitdiffstats
path: root/lib/agent
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-11-24 14:21:37 +0100
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-11-24 15:25:44 +0100
commitafe1f83bdbec2c369c0840c94df1d12c8faa0eeb (patch)
treee3c3ad307fb40b85a02783832c32e62f6210b5c2 /lib/agent
parenta3dd155428ef5c0b9ca1ca2c866cdf6f367f6191 (diff)
Improved and fixed connection to XDS Server
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'lib/agent')
-rw-r--r--lib/agent/apiv1-version.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/agent/apiv1-version.go b/lib/agent/apiv1-version.go
index c75e7f5..c73010e 100644
--- a/lib/agent/apiv1-version.go
+++ b/lib/agent/apiv1-version.go
@@ -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)
}