diff --git a/src/utils/lichess.tsx b/src/utils/lichess.tsx index 1d5eab7b..d1d55b7d 100644 --- a/src/utils/lichess.tsx +++ b/src/utils/lichess.tsx @@ -234,10 +234,9 @@ export async function downloadLichess( } export async function getLichessGame(gameId: string): Promise { - return ( - await fetch(`https://lichess.org/game/export/${gameId}`, { - method: "GET", - responseType: ResponseType.Text, - }) - ).data; + const response = await window.fetch(`https://lichess.org/game/export/${gameId}`); + if (!response.ok) { + throw new Error(`Failed to load lichess game ${gameId} - ${response.statusText}`); + } + return await response.text(); }