diff --git a/src/lib/waku_store/index.ts b/src/lib/waku_store/index.ts index 2d09c4c911..4a67dc70ee 100644 --- a/src/lib/waku_store/index.ts +++ b/src/lib/waku_store/index.ts @@ -216,7 +216,7 @@ export class WakuStore { const reply = historyRpcQuery.decode(bytes); if (!reply.response) { - throw "History response misses response field"; + dbg("No message returned from store: `response` field missing"); } const response = reply.response as protoV2Beta4.HistoryResponse; @@ -227,7 +227,7 @@ export class WakuStore { if (!response.messages || !response.messages.length) { // No messages left (or stored) - console.log("No messages present in HistoryRPC response"); + dbg("No message returned from store: `messages` array empty"); return messages; } @@ -265,8 +265,8 @@ export class WakuStore { cursor = response.pagingInfo?.cursor; if (cursor === undefined) { // If the server does not return cursor then there is an issue, - // Need to abort or we end up in an infinite loop - console.log("No cursor returned by peer."); + // Need to abort, or we end up in an infinite loop + dbg("Store response does not contain a cursor, stopping pagination"); return messages; } }