Skip to content

Commit a0c8ceb

Browse files
authored
fix: only log when data is invalid (#2862)
Only log an error when parsing peer data fails, not when it is not present.
1 parent 0f87479 commit a0c8ceb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/peer-store/src/store.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,10 @@ export class PersistentStore {
143143
existingBuf,
144144
existingPeer
145145
}
146-
} catch (err) {
147-
this.log.error('invalid peer data found in peer store - %e', err)
146+
} catch (err: any) {
147+
if (err.name !== 'NotFoundError') {
148+
this.log.error('invalid peer data found in peer store - %e', err)
149+
}
148150
}
149151

150152
return {}

0 commit comments

Comments
 (0)