@@ -35,7 +35,9 @@ func (as *AkashService) GetAkashDeployments(cfg config.Config, data *types.Async
35
35
if err != nil {
36
36
zap .L ().Fatal ("" , zap .Bool ("Success" , false ), zap .String ("err" , err .Error ()))
37
37
}
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
+ }
39
41
40
42
// get total deployments count
41
43
totalDeploymentsCount , err := strconv .Atoi (deployments .Pagination .Total )
@@ -49,7 +51,9 @@ func (as *AkashService) GetAkashDeployments(cfg config.Config, data *types.Async
49
51
if err != nil {
50
52
zap .L ().Fatal ("" , zap .Bool ("Success" , false ), zap .String ("err" , err .Error ()))
51
53
}
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
+ }
53
57
54
58
activeDeploymentsCount , err := strconv .Atoi (activeDeployments .Pagination .Total )
55
59
if err != nil {
@@ -74,7 +78,9 @@ func (as *AkashService) GetAkashProviders(cfg config.Config, data *types.AsyncDa
74
78
if err != nil {
75
79
zap .L ().Fatal ("" , zap .Bool ("Success" , false ), zap .String ("err" , err .Error ()))
76
80
}
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
+ }
78
84
79
85
// handle pagination
80
86
nextKey := providers .Pagination .NextKey
@@ -84,7 +90,9 @@ func (as *AkashService) GetAkashProviders(cfg config.Config, data *types.AsyncDa
84
90
zap .L ().Fatal ("" , zap .Bool ("Success" , false ), zap .String ("err" , err .Error ()))
85
91
}
86
92
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
+ }
88
96
89
97
// append to the response
90
98
providers .Providers = append (providers .Providers , nextPage .Providers ... )
@@ -175,7 +183,9 @@ func (as *AkashService) IndexAuditorForProviderOwners(cfg config.Config, provide
175
183
if err != nil {
176
184
return fmt .Errorf ("error querying auditors for provider owner: %w" , err )
177
185
}
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
+ }
179
189
180
190
// handle pagination
181
191
nextKey := auditors .Pagination .NextKey
@@ -185,7 +195,9 @@ func (as *AkashService) IndexAuditorForProviderOwners(cfg config.Config, provide
185
195
zap .L ().Fatal ("" , zap .Bool ("Success" , false ), zap .String ("err" , err .Error ()))
186
196
}
187
197
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
+ }
189
201
190
202
// append to the response
191
203
auditors .Providers = append (auditors .Providers , nextPage .Providers ... )
@@ -259,7 +271,9 @@ func (as *AkashService) IndexDeploymentForProviderOwner(cfg config.Config, provi
259
271
if err != nil {
260
272
return fmt .Errorf ("error querying deployments for provider owner: %w" , err )
261
273
}
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
+ }
263
277
264
278
// handle pagination
265
279
nextKey := deployments .Pagination .NextKey
@@ -269,7 +283,9 @@ func (as *AkashService) IndexDeploymentForProviderOwner(cfg config.Config, provi
269
283
zap .L ().Fatal ("" , zap .Bool ("Success" , false ), zap .String ("err" , err .Error ()))
270
284
}
271
285
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
+ }
273
289
274
290
// append to the response
275
291
deployments .Deployments = append (deployments .Deployments , nextPage .Deployments ... )
0 commit comments