X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=lib%2Fagent%2Fapiv1-version.go;h=c73010ef401263696ba25a99088a496060d7e461;hb=afe1f83bdbec2c369c0840c94df1d12c8faa0eeb;hp=c75e7f5da68714590f8928ed54fcd7bcc7070b8b;hpb=a3dd155428ef5c0b9ca1ca2c866cdf6f367f6191;p=src%2Fxds%2Fxds-agent.git 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) }