From 2f9d18cceafb4087b226703ebc538e887fb569b3 Mon Sep 17 00:00:00 2001 From: Andvari <31068367+dzx-dzx@users.noreply.github.com> Date: Mon, 2 Mar 2026 03:09:53 +0800 Subject: [PATCH] fix(route/reuters): Fix empty authors & prevent unintended fallback (#21256) * fix(route/reuters): Fix empty authors & prevent unintended fallback * Update lib/routes/reuters/common.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Fix error handling for FetchError in common.tsx * Update common.tsx --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- lib/routes/reuters/common.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/routes/reuters/common.tsx b/lib/routes/reuters/common.tsx index e1f6c085d..8b4f3f007 100644 --- a/lib/routes/reuters/common.tsx +++ b/lib/routes/reuters/common.tsx @@ -257,7 +257,7 @@ async function handler(ctx) { guid: e.id, pubDate: parseDate(e.published_time), updated: parseDate(e.updated_time), - author: e.authors.map((e) => e.name).join(', '), + author: e.authors?.map((e) => e.name).join(', '), category: e.kicker.names, description: e.description, })); @@ -329,7 +329,8 @@ async function handler(ctx) { link: `https://www.reuters.com${section_id}`, item: items, }; - } catch { + } catch (error: any) { + if (error?.name !== 'FetchError') { throw error; } // Fallback to arc outboundfeeds if API fails const arcUrl = topic ? `https://www.reuters.com/arc/outboundfeeds/v4/mobile/section${section_id}?outputType=json` : `https://www.reuters.com/arc/outboundfeeds/v4/mobile/section/${category}/?outputType=json`;