mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-14 22:52:15 +02:00
fix: add error logging to empty catch blocks in useMessagesElectric
Replaces 4 silent catch blocks with console.warn calls so sync failures are observable in the browser console. Cleanup catches at lines 147/155 stay silent since PGlite may already be closed. Fixes #905
This commit is contained in:
parent
5da2d95d80
commit
15e9f113e5
1 changed files with 8 additions and 8 deletions
|
|
@ -57,8 +57,8 @@ export function useMessagesElectric(
|
||||||
handle.initialSyncPromise,
|
handle.initialSyncPromise,
|
||||||
new Promise((resolve) => setTimeout(resolve, 3000)),
|
new Promise((resolve) => setTimeout(resolve, 3000)),
|
||||||
]);
|
]);
|
||||||
} catch {
|
} catch (err) {
|
||||||
// Timeout
|
console.warn("[useMessagesElectric] Sync timeout:", err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -70,8 +70,8 @@ export function useMessagesElectric(
|
||||||
syncHandleRef.current = handle;
|
syncHandleRef.current = handle;
|
||||||
await fetchMessages();
|
await fetchMessages();
|
||||||
await setupLiveQuery();
|
await setupLiveQuery();
|
||||||
} catch {
|
} catch (err) {
|
||||||
// Sync failed
|
console.warn("[useMessagesElectric] Sync failed:", err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -88,8 +88,8 @@ export function useMessagesElectric(
|
||||||
if (mounted && result.rows) {
|
if (mounted && result.rows) {
|
||||||
handleMessagesUpdate(result.rows);
|
handleMessagesUpdate(result.rows);
|
||||||
}
|
}
|
||||||
} catch {
|
} catch (err) {
|
||||||
// Query failed
|
console.warn("[useMessagesElectric] Query failed:", err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -130,8 +130,8 @@ export function useMessagesElectric(
|
||||||
liveQueryRef.current = liveQuery;
|
liveQueryRef.current = liveQuery;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch {
|
} catch (err) {
|
||||||
// Live query failed
|
console.warn("[useMessagesElectric] Live query failed:", err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue