mirror of
https://github.com/PR0M3TH3AN/TORCH.git
synced 2026-10-27 07:51:52 +00:00
docs: explain swallowed JSON parse error in relay-health.mjs
Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
264e2b5f61
commit
ec769d39cb
1 file changed
+2
@@ -138,6 +138,8 @@ async function probePublishRead(relayUrl, namespace, timeoutMs) {
|
||||
try {
|
||||
message = JSON.parse(raw.toString());
|
||||
} catch {
|
||||
// Ignore malformed messages. The relay might be sending non-JSON data
|
||||
// or we might have a protocol mismatch. We only care about valid JSON.
|
||||
return;
|
||||
}
|
||||
if (!Array.isArray(message) || message.length < 2) return;
|
||||
|
||||
Reference in new issue
Block a user