From 22f05580dff3e61ee112683c00e4afe19227feae Mon Sep 17 00:00:00 2001 From: mkelvers Date: Tue, 16 Jun 2026 01:14:31 +0200 Subject: [PATCH] fix: replace empty catch blocks with error logging --- static/player/main.ts | 4 +++- static/player/progress.ts | 4 +++- static/player/skip/editor.ts | 6 ++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/static/player/main.ts b/static/player/main.ts index ea58a6d..6818f02 100644 --- a/static/player/main.ts +++ b/static/player/main.ts @@ -274,7 +274,9 @@ const initPlayer = (): void => { state.isScrubbing = true; try { (e.currentTarget as HTMLElement).setPointerCapture((e as PointerEvent).pointerId); - } catch {} + } catch (e) { + console.warn("Failed to capture pointer:", e); + } scrubToPointer(e.clientX, true); }, { signal }, diff --git a/static/player/progress.ts b/static/player/progress.ts index 5b55b45..93d8aef 100644 --- a/static/player/progress.ts +++ b/static/player/progress.ts @@ -69,7 +69,9 @@ export const saveProgress = async ( episode: state.currentEpisode, seconds: savedTime, }; - } catch {} + } catch (e) { + console.warn("Progress save failed:", e); + } })(); saveProgressInFlight = request; diff --git a/static/player/skip/editor.ts b/static/player/skip/editor.ts index 54916ef..6397349 100644 --- a/static/player/skip/editor.ts +++ b/static/player/skip/editor.ts @@ -211,10 +211,8 @@ export const setupSegmentEditor = (): void => { }); if (!res.ok) { let message = res.status === 401 ? "Login required." : "Failed to save segment."; - try { - const payload = (await res.json()) as { error?: string }; - if (payload?.error) message = payload.error; - } catch {} + const payload = (await res.json().catch(() => null)) as { error?: string } | null; + if (payload?.error) message = payload.error; setError(message); return; }