suppress RPC errors if configured to do so
This commit is contained in:
parent
b578803136
commit
d585fce67b
@ -232,7 +232,9 @@ const handleMessage = function (ctx, user, msg) {
|
|||||||
// slice off the sequence number and pass in the rest of the message
|
// slice off the sequence number and pass in the rest of the message
|
||||||
ctx.rpc(ctx, rpc_call, function (err, output) {
|
ctx.rpc(ctx, rpc_call, function (err, output) {
|
||||||
if (err) {
|
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, [seq, 'ACK']);
|
||||||
sendMsg(ctx, user, [0, HISTORY_KEEPER_ID, 'MSG', user.id, JSON.stringify([parsed[0], 'ERROR', err])]);
|
sendMsg(ctx, user, [0, HISTORY_KEEPER_ID, 'MSG', user.id, JSON.stringify([parsed[0], 'ERROR', err])]);
|
||||||
return
|
return
|
||||||
|
|||||||
@ -137,6 +137,11 @@ module.exports = {
|
|||||||
*/
|
*/
|
||||||
rpc: './rpc.js',
|
rpc: './rpc.js',
|
||||||
|
|
||||||
|
/* RPC errors are shown by default, but if you really don't care,
|
||||||
|
* you can suppress them
|
||||||
|
*/
|
||||||
|
suppressRPCErrors: false,
|
||||||
|
|
||||||
/* it is recommended that you serve cryptpad over https
|
/* it is recommended that you serve cryptpad over https
|
||||||
* the filepaths below are used to configure your certificates
|
* the filepaths below are used to configure your certificates
|
||||||
*/
|
*/
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user