diff --git a/js/twister_actions.js b/js/twister_actions.js index a245089..b91d68d 100644 --- a/js/twister_actions.js +++ b/js/twister_actions.js @@ -350,7 +350,7 @@ function newShortURI(uri, cbFunc, cbReq) { req.cbFunc(req.cbReq, req.uri, ret); }, {uri: uri, cbFunc: cbFunc, cbReq: cbReq}, function (req, ret) { - console.warn('RPC "newshorturl" error: ' + (ret && ret.message) ? ret.message : ret); + console.warn('RPC "newshorturl" error: ' + (ret && ret.message ? ret.message : ret)); if (typeof req.cbFunc === 'function') req.cbFunc(req.cbReq, req.uri, ret); }, {uri: uri, cbFunc: cbFunc, cbReq: cbReq} diff --git a/js/twister_following.js b/js/twister_following.js index bb78ff6..72da9a5 100644 --- a/js/twister_following.js +++ b/js/twister_following.js @@ -591,7 +591,9 @@ function searchPartialUsername(event) { _searchingPartialName = ''; } }, event, - function(req, ret) {console.warn('ajax error:' + ret.message);}, null + function(req, ret) { + console.warn('RPC "listusernamespartial" error: ' + (ret && ret.message ? ret.message : ret)); + }, null ); } diff --git a/js/twister_io.js b/js/twister_io.js index 3de9e4c..9ab1ac3 100644 --- a/js/twister_io.js +++ b/js/twister_io.js @@ -148,7 +148,7 @@ function _dhtgetInternal(peerAlias, resource, multi, timeoutArgs) { _dhtgetDequeue(); }, {locator: locator, multi: multi}, function(req, ret) { - console.warn('RPC "dhtget" error: ' + (ret && ret.message) ? ret.message : ret); + console.warn('RPC "dhtget" error: ' + (ret && ret.message ? ret.message : ret)); _dhtgetsInProgress--; _dhtgetAbortPending(req); _dhtgetDequeue(); @@ -169,7 +169,7 @@ function _decodeshorturlInternal(locator, timeoutArgs) { _dhtgetDequeue(); }, locator, function(req, ret) { - console.warn('RPC "decodeshorturl" error: ' + (ret && ret.message) ? ret.message : ret); + console.warn('RPC "decodeshorturl" error: ' + (ret && ret.message ? ret.message : ret)); _dhtgetsInProgress--; _dhtgetAbortPending(req); _dhtgetDequeue(); @@ -217,7 +217,7 @@ function dhtput(peerAlias, resource, multi, value, sig_user, seq, cbFunc, cbReq) req.cbFunc(req.cbReq, true); }, {cbFunc: cbFunc, cbReq: cbReq}, function(req, ret) { - console.warn('RPC "dhtput" error: ' + (ret && ret.message) ? ret.message : ret); + console.warn('RPC "dhtput" error: ' + (ret && ret.message ? ret.message : ret)); if (req.cbFunc) req.cbFunc(req.cbReq, false); }, {cbFunc: cbFunc, cbReq: cbReq} @@ -364,7 +364,7 @@ function getGroupChatName(groupAlias, elem) { elem.text(ret.description); }, elem, function(req, ret) { - console.warn('RPC "getgroupinfo" error: ' + (ret && ret.message) ? ret.message : ret); + console.warn('RPC "getgroupinfo" error: ' + (ret && ret.message ? ret.message : ret)); req.elem.text(req.groupAlias); }, {elem: elem, groupAlias: groupAlias} ); @@ -526,7 +526,7 @@ function getPostMaxAvailability(peerAlias, k, cbFunc, cbReq) { req.cbFunc(req.cbReq, ret); }, {cbFunc: cbFunc, cbReq: cbReq}, function(req, ret) { - console.warn('RPC "getpiecemaxseen" error: ' + (ret && ret.message) ? ret.message : ret); + console.warn('RPC "getpiecemaxseen" error: ' + (ret && ret.message ? ret.message : ret)); } ); } @@ -539,7 +539,7 @@ function checkPubkeyExists(peerAlias, cbFunc, cbReq) { req.cbFunc(req.cbReq, ret.length > 0); }, {cbFunc: cbFunc, cbReq: cbReq}, function(req, ret) { - console.warn('RPC "dumppubkey" error: ' + (ret && ret.message) ? ret.message : ret); + console.warn('RPC "dumppubkey" error: ' + (ret && ret.message ? ret.message : ret)); alert(polyglot.t('error_connecting_to_daemon')); } ); @@ -564,7 +564,7 @@ function dumpPubkey(peerAlias, cbFunc, cbReq) { } }, {cbFunc: cbFunc, cbReq: cbReq}, function (req, ret) { - console.warn('RPC "dumppubkey" error: ' + (ret && ret.message) ? ret.message : ret); + console.warn('RPC "dumppubkey" error: ' + (ret && ret.message ? ret.message : ret)); alert(polyglot.t('error_connecting_to_daemon')); } ); @@ -580,7 +580,7 @@ function dumpPrivkey(peerAlias, cbFunc, cbReq) { }, {cbFunc: cbFunc, cbReq: cbReq}, function(req, ret) { req.cbFunc(req.cbReq, ''); - console.warn('user unknown — RPC "dumppubkey" error: ' + ret.message); + console.warn('user unknown — RPC "dumppubkey" error: ' + (ret && ret.message ? ret.message : ret)); }, {cbFunc: cbFunc, cbReq: cbReq} ); }