fix: replace empty catch blocks with error logging
This commit is contained in:
@@ -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 },
|
||||
|
||||
@@ -69,7 +69,9 @@ export const saveProgress = async (
|
||||
episode: state.currentEpisode,
|
||||
seconds: savedTime,
|
||||
};
|
||||
} catch {}
|
||||
} catch (e) {
|
||||
console.warn("Progress save failed:", e);
|
||||
}
|
||||
})();
|
||||
|
||||
saveProgressInFlight = request;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user