From 2676a240bba469f73452576b795c81a5cf95bf50 Mon Sep 17 00:00:00 2001 From: SHUBHANSHU602 Date: Tue, 17 Feb 2026 06:04:53 +0530 Subject: [PATCH] refactor(dashboard): simplify error handling in build-dashboard --- scripts/dashboard/build-dashboard.ts | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/scripts/dashboard/build-dashboard.ts b/scripts/dashboard/build-dashboard.ts index 43a48185ecd9..aa69bf989236 100644 --- a/scripts/dashboard/build-dashboard.ts +++ b/scripts/dashboard/build-dashboard.ts @@ -104,10 +104,9 @@ async function getDiscussions( } return result.search.nodes.concat(await getDiscussions(query, pageSize, result.search.pageInfo.endCursor)); - } catch (e) { - logger.error(e); - - return Promise.reject(e); + } catch (error) { + logger.error(error); + throw error; } } @@ -138,10 +137,9 @@ async function getDiscussionByID(isPR: boolean, id: string): Promise { ]); await writeToFile({ hotDiscussions, goodFirstIssues }, writePath); - } catch (e) { + } catch (error) { logger.error('There were some issues parsing data from github.'); - logger.error(e); + logger.error(error); } }