fix : log lichess error
This commit is contained in:
@@ -53,7 +53,7 @@ export const getLichessEval = async (
|
|||||||
lines: linesToKeep,
|
lines: linesToKeep,
|
||||||
};
|
};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error !== "timeout") {
|
if (!isAbortError(error)) {
|
||||||
logErrorToSentry(error, { fen, multiPv });
|
logErrorToSentry(error, { fen, multiPv });
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,6 +64,11 @@ export const getLichessEval = async (
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const isAbortError = (error: unknown): boolean =>
|
||||||
|
error === "timeout" ||
|
||||||
|
((error instanceof Error || error instanceof DOMException) &&
|
||||||
|
(error.name === "AbortError" || error.message === "timeout"));
|
||||||
|
|
||||||
export const getLichessUserRecentGames = async (
|
export const getLichessUserRecentGames = async (
|
||||||
username: string
|
username: string
|
||||||
): Promise<LichessGame[]> => {
|
): Promise<LichessGame[]> => {
|
||||||
|
|||||||
Reference in New Issue
Block a user