aboutsummaryrefslogtreecommitdiffstats
path: root/lib/agent/apiv1-version.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib/agent/apiv1-version.go')
-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)
}