Commit 03cc6fa02bde08504c85513f6ba739fed73bb81a
1 parent
6d6594c9d7
Exists in
master
angin segar
Showing 1 changed file with 5 additions and 8 deletions Side-by-side Diff
xmlrpc-server.js
... | ... | @@ -343,20 +343,17 @@ function sendTopUpReport(reverseUrls, params, urlIdx, retry) { |
343 | 343 | |
344 | 344 | var methodName = 'topUpReport'; |
345 | 345 | logger.info('Requesting topUpReport', {params: params}); |
346 | - client.methodCall(methodName, [ params ], function (error, value) { | |
346 | + client.methodCall(methodName, [ params ], function (topupReportError, value) { | |
347 | 347 | |
348 | 348 | try { |
349 | 349 | |
350 | - if (error) { | |
351 | - if ((error.constructor !== Object) || (Object.keys(error).length === 0)) { | |
352 | - logger.warn('Error sending topUpReport retrying another url (if available)', {error: error, value: value}); | |
353 | - sendTopUpReport(reverseUrls, params, ++urlIdx, retry); | |
354 | - return; | |
355 | - } | |
350 | + if (topupReportError.constructor === Object && Object.keys(topupReportError).length >= 0) { | |
351 | + logger.warn('Error sending topUpReport retrying another url (if available)', {error: topupReportError, value: value}); | |
352 | + sendTopUpReport(reverseUrls, params, ++urlIdx, retry); | |
353 | + return; | |
356 | 354 | } |
357 | 355 | |
358 | 356 | logger.verbose("topUpReport ACK", {error: error, value: value}); |
359 | - | |
360 | 357 | } |
361 | 358 | catch(topUpReportException) { |
362 | 359 | logger.warn("Exception on sending topUpReport", {e: topUpReportException}); |