diff --git a/frontend/src/ts/utils/json-data.ts b/frontend/src/ts/utils/json-data.ts index 113ee91ff..433d45b9f 100644 --- a/frontend/src/ts/utils/json-data.ts +++ b/frontend/src/ts/utils/json-data.ts @@ -89,11 +89,7 @@ export type Layout = { * @throws {Error} If the layout list or layout doesn't exist. */ export async function getLayout(layoutName: string): Promise { - try { - return await cachedFetchJson(`/layouts/${layoutName}.json`); - } catch (e) { - throw new Error(`Layout ${layoutName} JSON fetch failed`); - } + return await cachedFetchJson(`/layouts/${layoutName}.json`); } export type Theme = { @@ -161,14 +157,8 @@ export async function getSortedThemesList(): Promise { * @returns A promise that resolves to the list of languages. */ export async function getLanguageList(): Promise { - try { - const languageList = await cachedFetchJson( - "/languages/_list.json" - ); - return languageList; - } catch (e) { - throw new Error("Language list JSON fetch failed"); - } + const languageList = await cachedFetchJson("/languages/_list.json"); + return languageList; } export type LanguageGroup = { @@ -181,14 +171,10 @@ export type LanguageGroup = { * @returns A promise that resolves to the list of language groups. */ export async function getLanguageGroups(): Promise { - try { - const languageGroupList = await cachedFetchJson( - "/languages/_groups.json" - ); - return languageGroupList; - } catch (e) { - throw new Error("Language groups JSON fetch failed"); - } + const languageGroupList = await cachedFetchJson( + "/languages/_groups.json" + ); + return languageGroupList; } export type LanguageObject = { @@ -211,7 +197,6 @@ let currentLanguage: LanguageObject; * @returns A promise that resolves to the language object. */ export async function getLanguage(lang: string): Promise { - // try { if (currentLanguage === undefined || currentLanguage.name !== lang) { currentLanguage = await cachedFetchJson( `/languages/${lang}.json` @@ -317,12 +302,8 @@ export type Challenge = { * @returns A promise that resolves to the list of challenges. */ export async function getChallengeList(): Promise { - try { - const data = await cachedFetchJson("/challenges/_list.json"); - return data; - } catch (e) { - throw new Error("Challenge list JSON fetch failed"); - } + const data = await cachedFetchJson("/challenges/_list.json"); + return data; } /** @@ -330,12 +311,8 @@ export async function getChallengeList(): Promise { * @returns A promise that resolves to the list of supporters. */ export async function getSupportersList(): Promise { - try { - const data = await cachedFetchJson("/about/supporters.json"); - return data; - } catch (e) { - throw new Error("Supporters list JSON fetch failed"); - } + const data = await cachedFetchJson("/about/supporters.json"); + return data; } /** @@ -343,12 +320,8 @@ export async function getSupportersList(): Promise { * @returns A promise that resolves to the list of contributors. */ export async function getContributorsList(): Promise { - try { - const data = await cachedFetchJson("/about/contributors.json"); - return data; - } catch (e) { - throw new Error("Contributors list JSON fetch failed"); - } + const data = await cachedFetchJson("/about/contributors.json"); + return data; } type GithubRelease = {