Merge pull request #923 from mvanhorn/osc/905-catch-error-handling

fix: add error logging to empty catch blocks in useMessagesElectric
This commit is contained in:
Rohan Verma 2026-03-24 00:14:50 -07:00 committed by GitHub
commit 354d80bf7a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -57,8 +57,8 @@ export function useMessagesElectric(
handle.initialSyncPromise,
new Promise((resolve) => setTimeout(resolve, 3000)),
]);
} catch {
// Timeout
} catch (err) {
console.warn("[useMessagesElectric] Sync timeout:", err);
}
}
@ -70,8 +70,8 @@ export function useMessagesElectric(
syncHandleRef.current = handle;
await fetchMessages();
await setupLiveQuery();
} catch {
// Sync failed
} catch (err) {
console.warn("[useMessagesElectric] Sync failed:", err);
}
}
@ -88,8 +88,8 @@ export function useMessagesElectric(
if (mounted && result.rows) {
handleMessagesUpdate(result.rows);
}
} catch {
// Query failed
} catch (err) {
console.warn("[useMessagesElectric] Query failed:", err);
}
}
@ -130,8 +130,8 @@ export function useMessagesElectric(
liveQueryRef.current = liveQuery;
}
}
} catch {
// Live query failed
} catch (err) {
console.warn("[useMessagesElectric] Live query failed:", err);
}
}