Skip to content

Commit

Permalink
chore: update logging
Browse files Browse the repository at this point in the history
  • Loading branch information
danisharora099 committed Sep 19, 2024
1 parent 38e6a89 commit acef1ac
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
15 changes: 13 additions & 2 deletions packages/core/src/lib/filter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export class FilterCore extends BaseProtocol implements IBaseProtocolCore {
wakuMessage: WakuMessage,
peerIdStr: string
) => Promise<void>,
private handleError: (error: Error) => Promise<void>,
public readonly pubsubTopics: PubsubTopic[],
libp2p: Libp2p
) {
Expand Down Expand Up @@ -301,8 +302,18 @@ export class FilterCore extends BaseProtocol implements IBaseProtocolCore {
() => {
log.info("Receiving pipe closed.");
},
(e) => {
log.error("Error with receiving pipe", e);
async (e) => {
log.error(
"Error with receiving pipe",
e,
" -- ",
"on peer ",
connection.remotePeer.toString(),
" -- ",
"stream ",
stream
);
await this.handleError(e);
}
);
} catch (e) {
Expand Down
3 changes: 3 additions & 0 deletions packages/sdk/src/protocols/filter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ class FilterSDK extends BaseProtocolSDK implements IFilterSDK {

await subscription.processIncomingMessage(wakuMessage, peerIdStr);
},
async (error: Error) => {
log.error("Error with receiving pipe", error);
},
connectionManager.configuredPubsubTopics,
libp2p
),
Expand Down

0 comments on commit acef1ac

Please sign in to comment.