From 061cb548d0bf06a2e2ec7086abd0206a88fbe31f Mon Sep 17 00:00:00 2001 From: mrjvs Date: Fri, 29 Dec 2023 13:02:55 +0100 Subject: [PATCH] Fix error messages for providers api --- src/hooks/useProviderScrape.tsx | 2 +- src/pages/parts/player/ScrapeErrorPart.tsx | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hooks/useProviderScrape.tsx b/src/hooks/useProviderScrape.tsx index 2ee2af5b..44f823da 100644 --- a/src/hooks/useProviderScrape.tsx +++ b/src/hooks/useProviderScrape.tsx @@ -23,7 +23,7 @@ export interface ScrapingSegment { embedId?: string; status: "failure" | "pending" | "notfound" | "success" | "waiting"; reason?: string; - error?: unknown; + error?: any; percentage: number; } diff --git a/src/pages/parts/player/ScrapeErrorPart.tsx b/src/pages/parts/player/ScrapeErrorPart.tsx index 6b52c796..75526ca2 100644 --- a/src/pages/parts/player/ScrapeErrorPart.tsx +++ b/src/pages/parts/player/ScrapeErrorPart.tsx @@ -35,6 +35,8 @@ export function ScrapeErrorPart(props: ScrapeErrorPartProps) { Object.values(data.sources).forEach((v) => { str += `${v.id}: ${v.status}\n`; if (v.reason) str += `${v.reason}\n`; + if (v.error?.message) + str += `${v.error.name ?? "unknown"}: ${v.error.message}\n`; if (v.error) str += `${v.error.toString()}\n`; }); return str;