fix : log lichess error
This commit is contained in:
@@ -53,7 +53,7 @@ export const getLichessEval = async (
|
||||
lines: linesToKeep,
|
||||
};
|
||||
} catch (error) {
|
||||
if (error !== "timeout") {
|
||||
if (!isAbortError(error)) {
|
||||
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 (
|
||||
username: string
|
||||
): Promise<LichessGame[]> => {
|
||||
|
||||
Reference in New Issue
Block a user