mirror of
https://github.com/KuekHaoYang/KVideo.git
synced 2026-08-21 19:53:43 +08:00
feat: Improve service worker network error handling by returning 503 responses instead of throwing and refine client-side error logging for network unavailability.
This commit is contained in:
@@ -12,7 +12,10 @@ export interface Segment {
|
||||
export async function parseHLSManifest(src: string): Promise<Segment[]> {
|
||||
const response = await fetch(src);
|
||||
if (!response.ok) {
|
||||
throw new Error(`Failed to fetch manifest: ${response.status}`);
|
||||
const errorMsg = response.status === 503
|
||||
? `Network unavailable (Service Worker offline): ${src}`
|
||||
: `Failed to fetch manifest (${response.status}): ${src}`;
|
||||
throw new Error(errorMsg);
|
||||
}
|
||||
const manifestText = await response.text();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user