fix RPC console warnings

This commit is contained in:
Simon Grim 2016-03-22 21:31:12 +05:00
parent dacf0ac1ce
commit aad737f10d
3 changed files with 12 additions and 10 deletions

View File

@ -350,7 +350,7 @@ function newShortURI(uri, cbFunc, cbReq) {
req.cbFunc(req.cbReq, req.uri, ret); req.cbFunc(req.cbReq, req.uri, ret);
}, {uri: uri, cbFunc: cbFunc, cbReq: cbReq}, }, {uri: uri, cbFunc: cbFunc, cbReq: cbReq},
function (req, ret) { 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') if (typeof req.cbFunc === 'function')
req.cbFunc(req.cbReq, req.uri, ret); req.cbFunc(req.cbReq, req.uri, ret);
}, {uri: uri, cbFunc: cbFunc, cbReq: cbReq} }, {uri: uri, cbFunc: cbFunc, cbReq: cbReq}

View File

@ -591,7 +591,9 @@ function searchPartialUsername(event) {
_searchingPartialName = ''; _searchingPartialName = '';
} }
}, event, }, 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
); );
} }

View File

@ -148,7 +148,7 @@ function _dhtgetInternal(peerAlias, resource, multi, timeoutArgs) {
_dhtgetDequeue(); _dhtgetDequeue();
}, {locator: locator, multi: multi}, }, {locator: locator, multi: multi},
function(req, ret) { 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--; _dhtgetsInProgress--;
_dhtgetAbortPending(req); _dhtgetAbortPending(req);
_dhtgetDequeue(); _dhtgetDequeue();
@ -169,7 +169,7 @@ function _decodeshorturlInternal(locator, timeoutArgs) {
_dhtgetDequeue(); _dhtgetDequeue();
}, locator, }, locator,
function(req, ret) { 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--; _dhtgetsInProgress--;
_dhtgetAbortPending(req); _dhtgetAbortPending(req);
_dhtgetDequeue(); _dhtgetDequeue();
@ -217,7 +217,7 @@ function dhtput(peerAlias, resource, multi, value, sig_user, seq, cbFunc, cbReq)
req.cbFunc(req.cbReq, true); req.cbFunc(req.cbReq, true);
}, {cbFunc: cbFunc, cbReq: cbReq}, }, {cbFunc: cbFunc, cbReq: cbReq},
function(req, ret) { 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) if (req.cbFunc)
req.cbFunc(req.cbReq, false); req.cbFunc(req.cbReq, false);
}, {cbFunc: cbFunc, cbReq: cbReq} }, {cbFunc: cbFunc, cbReq: cbReq}
@ -364,7 +364,7 @@ function getGroupChatName(groupAlias, elem) {
elem.text(ret.description); elem.text(ret.description);
}, elem, }, elem,
function(req, ret) { 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); req.elem.text(req.groupAlias);
}, {elem: elem, groupAlias: groupAlias} }, {elem: elem, groupAlias: groupAlias}
); );
@ -526,7 +526,7 @@ function getPostMaxAvailability(peerAlias, k, cbFunc, cbReq) {
req.cbFunc(req.cbReq, ret); req.cbFunc(req.cbReq, ret);
}, {cbFunc: cbFunc, cbReq: cbReq}, }, {cbFunc: cbFunc, cbReq: cbReq},
function(req, ret) { 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); req.cbFunc(req.cbReq, ret.length > 0);
}, {cbFunc: cbFunc, cbReq: cbReq}, }, {cbFunc: cbFunc, cbReq: cbReq},
function(req, ret) { 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')); alert(polyglot.t('error_connecting_to_daemon'));
} }
); );
@ -564,7 +564,7 @@ function dumpPubkey(peerAlias, cbFunc, cbReq) {
} }
}, {cbFunc: cbFunc, cbReq: cbReq}, }, {cbFunc: cbFunc, cbReq: cbReq},
function (req, ret) { 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')); alert(polyglot.t('error_connecting_to_daemon'));
} }
); );
@ -580,7 +580,7 @@ function dumpPrivkey(peerAlias, cbFunc, cbReq) {
}, {cbFunc: cbFunc, cbReq: cbReq}, }, {cbFunc: cbFunc, cbReq: cbReq},
function(req, ret) { function(req, ret) {
req.cbFunc(req.cbReq, ''); 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} }, {cbFunc: cbFunc, cbReq: cbReq}
); );
} }