@@ -87,12 +87,12 @@ func (handler *CommonDeploymentRestHandlerImpl) getAppOfferingMode(installedAppI
8787	if  len (appId ) >  0  {
8888		appIdentifier , err  :=  handler .helmAppService .DecodeAppId (appId )
8989		if  err  !=  nil  {
90- 			err  =  & util.ApiError {HttpStatusCode : http .StatusBadRequest , UserMessage : "invalid app id" }
90+ 			//  err = &util.ApiError{HttpStatusCode: http.StatusBadRequest, UserMessage: "invalid app id"}
9191			return  appOfferingMode , installedAppDto , err 
9292		}
9393		installedAppDto , err  =  handler .installedAppService .GetInstalledAppByClusterNamespaceAndName (appIdentifier )
9494		if  err  !=  nil  {
95- 			err  =  & util.ApiError {HttpStatusCode : http .StatusBadRequest , UserMessage : "unable to find app in database" }
95+ 			//  err = &util.ApiError{HttpStatusCode: http.StatusBadRequest, UserMessage: "unable to find app in database"}
9696			return  appOfferingMode , installedAppDto , err 
9797		}
9898		// this is the case when hyperion apps does not linked yet 
@@ -103,7 +103,7 @@ func (handler *CommonDeploymentRestHandlerImpl) getAppOfferingMode(installedAppI
103103			installedAppDto .AppOfferingMode  =  appOfferingMode 
104104			appIdentifier , err  :=  handler .helmAppService .DecodeAppId (appId )
105105			if  err  !=  nil  {
106- 				err  =  & util.ApiError {HttpStatusCode : http .StatusBadRequest , UserMessage : "invalid app id, expected format clusterId|namespace|releaseName" }
106+ 				//  err = &util.ApiError{HttpStatusCode: http.StatusBadRequest, UserMessage: "invalid app id, expected format clusterId|namespace|releaseName"}
107107				return  appOfferingMode , installedAppDto , err 
108108			}
109109			installedAppDto .ClusterId  =  appIdentifier .ClusterId 
@@ -113,16 +113,17 @@ func (handler *CommonDeploymentRestHandlerImpl) getAppOfferingMode(installedAppI
113113	} else  if  len (installedAppId ) >  0  {
114114		installedAppId , err  :=  strconv .Atoi (installedAppId )
115115		if  err  !=  nil  {
116- 			err   =   & util. ApiError { HttpStatusCode :  http . StatusBadRequest ,  UserMessage :  "invalid installed app id" } 
116+ 			handler . Logger . Errorw ( "Invalid installedAppId expected int value" ,  "installedAppId" ,  installedAppId ,  "err" ,  err ) 
117117			return  appOfferingMode , installedAppDto , err 
118118		}
119119		installedAppDto , err  =  handler .installedAppService .GetInstalledAppByInstalledAppId (installedAppId )
120120		if  err  !=  nil  {
121- 			err  =  & util.ApiError {HttpStatusCode : http .StatusBadRequest , UserMessage : "unable to find app in database" }
121+ 			//  err = &util.ApiError{HttpStatusCode: http.StatusBadRequest, UserMessage: "unable to find app in database"}
122122			return  appOfferingMode , installedAppDto , err 
123123		}
124124	} else  {
125125		err  :=  & util.ApiError {HttpStatusCode : http .StatusBadRequest , UserMessage : "app id missing in request" }
126+ 		handler .Logger .Errorw ("appId is missing and is a required field" , "appId" , appId , "err" , err )
126127		return  appOfferingMode , installedAppDto , err 
127128	}
128129	if  installedAppDto  !=  nil  &&  installedAppDto .InstalledAppId  >  0  {
@@ -188,6 +189,7 @@ func (handler *CommonDeploymentRestHandlerImpl) GetDeploymentHistoryValues(w htt
188189	v  :=  r .URL .Query ()
189190	installedAppId  :=  v .Get ("installedAppId" )
190191	appId  :=  v .Get ("appId" )
192+ 
191193	appOfferingMode , installedAppDto , err  :=  handler .getAppOfferingMode (installedAppId , appId )
192194	if  err  !=  nil  {
193195		common .WriteJsonResp (w , err , "bad request" , http .StatusBadRequest )
0 commit comments