provide more context for EUNKNOWN logs

pull/1/head
ansuz 4 years ago
parent b568f1b3ae
commit 8990e8def9

@ -639,7 +639,15 @@ const handleGetHistory = function (Env, Server, seq, userId, parsed) {
Server.send(userId, [0, HISTORY_KEEPER_ID, 'MSG', userId, JSON.stringify(msg)], readMore);
}, (err) => {
if (err && err.code !== 'ENOENT') {
if (err.message !== 'EINVAL') { Log.error("HK_GET_HISTORY", {
if (err.message === "EUNKNOWN") {
Log.error("HK_GET_HISTORY", {
channel: channelName,
lastKnownHash: lastKnownHash,
userId: userId,
sessions: Object.keys(HK.getNetfluxSession(Env, userId) || {}),
err: err && err.message || err,
});
} else if (err.message !== 'EINVAL') { Log.error("HK_GET_HISTORY", {
channel: channelName,
err: err && err.message || err,
stack: err && err.stack,

Loading…
Cancel
Save