suppress RPC errors if configured to do so

This commit is contained in:
ansuz
2017-03-16 13:07:01 +01:00
parent b578803136
commit d585fce67b
2 changed files with 8 additions and 1 deletions

View File

@@ -232,7 +232,9 @@ const handleMessage = function (ctx, user, msg) {
// slice off the sequence number and pass in the rest of the message
ctx.rpc(ctx, rpc_call, function (err, output) {
if (err) {
console.error('[' + err + ']', output); // TODO make this disableable
if (!ctx.config.suppressRPCErrors) {
console.error('[' + err + ']', output);
}
sendMsg(ctx, user, [seq, 'ACK']);
sendMsg(ctx, user, [0, HISTORY_KEEPER_ID, 'MSG', user.id, JSON.stringify([parsed[0], 'ERROR', err])]);
return