@@ -35,7 +35,9 @@ func (as *AkashService) GetAkashDeployments(cfg config.Config, data *types.Async
3535 if err != nil {
3636 zap .L ().Fatal ("" , zap .Bool ("Success" , false ), zap .String ("err" , err .Error ()))
3737 }
38- json .Unmarshal (res , & deployments )
38+ if err := json .Unmarshal (res , & deployments ); err != nil {
39+ zap .L ().Info ("" , zap .Bool ("Success" , false ), zap .String ("err" , err .Error ()))
40+ }
3941
4042 // get total deployments count
4143 totalDeploymentsCount , err := strconv .Atoi (deployments .Pagination .Total )
@@ -49,7 +51,9 @@ func (as *AkashService) GetAkashDeployments(cfg config.Config, data *types.Async
4951 if err != nil {
5052 zap .L ().Fatal ("" , zap .Bool ("Success" , false ), zap .String ("err" , err .Error ()))
5153 }
52- json .Unmarshal (resActive , & activeDeployments )
54+ if err := json .Unmarshal (resActive , & activeDeployments ); err != nil {
55+ zap .L ().Info ("" , zap .Bool ("Success" , false ), zap .String ("err" , err .Error ()))
56+ }
5357
5458 activeDeploymentsCount , err := strconv .Atoi (activeDeployments .Pagination .Total )
5559 if err != nil {
@@ -74,7 +78,9 @@ func (as *AkashService) GetAkashProviders(cfg config.Config, data *types.AsyncDa
7478 if err != nil {
7579 zap .L ().Fatal ("" , zap .Bool ("Success" , false ), zap .String ("err" , err .Error ()))
7680 }
77- json .Unmarshal (res , & providers )
81+ if err := json .Unmarshal (res , & providers ); err != nil {
82+ zap .L ().Info ("" , zap .Bool ("Success" , false ), zap .String ("err" , err .Error ()))
83+ }
7884
7985 // handle pagination
8086 nextKey := providers .Pagination .NextKey
@@ -84,7 +90,9 @@ func (as *AkashService) GetAkashProviders(cfg config.Config, data *types.AsyncDa
8490 zap .L ().Fatal ("" , zap .Bool ("Success" , false ), zap .String ("err" , err .Error ()))
8591 }
8692 var nextPage akash.ProvidersResponse
87- json .Unmarshal (res , & nextPage )
93+ if err := json .Unmarshal (res , & nextPage ); err != nil {
94+ zap .L ().Info ("" , zap .Bool ("Success" , false ), zap .String ("err" , err .Error ()))
95+ }
8896
8997 // append to the response
9098 providers .Providers = append (providers .Providers , nextPage .Providers ... )
@@ -175,7 +183,9 @@ func (as *AkashService) IndexAuditorForProviderOwners(cfg config.Config, provide
175183 if err != nil {
176184 return fmt .Errorf ("error querying auditors for provider owner: %w" , err )
177185 }
178- json .Unmarshal (res , & auditors )
186+ if err := json .Unmarshal (res , & auditors ); err != nil {
187+ zap .L ().Info ("" , zap .Bool ("Success" , false ), zap .String ("err" , err .Error ()))
188+ }
179189
180190 // handle pagination
181191 nextKey := auditors .Pagination .NextKey
@@ -185,7 +195,9 @@ func (as *AkashService) IndexAuditorForProviderOwners(cfg config.Config, provide
185195 zap .L ().Fatal ("" , zap .Bool ("Success" , false ), zap .String ("err" , err .Error ()))
186196 }
187197 var nextPage akash.AuditorsResponse
188- json .Unmarshal (res , & nextPage )
198+ if err := json .Unmarshal (res , & nextPage ); err != nil {
199+ zap .L ().Info ("" , zap .Bool ("Success" , false ), zap .String ("err" , err .Error ()))
200+ }
189201
190202 // append to the response
191203 auditors .Providers = append (auditors .Providers , nextPage .Providers ... )
@@ -259,7 +271,9 @@ func (as *AkashService) IndexDeploymentForProviderOwner(cfg config.Config, provi
259271 if err != nil {
260272 return fmt .Errorf ("error querying deployments for provider owner: %w" , err )
261273 }
262- json .Unmarshal (res , & deployments )
274+ if err := json .Unmarshal (res , & deployments ); err != nil {
275+ zap .L ().Info ("" , zap .Bool ("Success" , false ), zap .String ("err" , err .Error ()))
276+ }
263277
264278 // handle pagination
265279 nextKey := deployments .Pagination .NextKey
@@ -269,7 +283,9 @@ func (as *AkashService) IndexDeploymentForProviderOwner(cfg config.Config, provi
269283 zap .L ().Fatal ("" , zap .Bool ("Success" , false ), zap .String ("err" , err .Error ()))
270284 }
271285 var nextPage akash.DeploymentsResponse
272- json .Unmarshal (res , & nextPage )
286+ if err := json .Unmarshal (res , & nextPage ); err != nil {
287+ zap .L ().Info ("" , zap .Bool ("Success" , false ), zap .String ("err" , err .Error ()))
288+ }
273289
274290 // append to the response
275291 deployments .Deployments = append (deployments .Deployments , nextPage .Deployments ... )
0 commit comments