fix : lichess timeout errors handling

This commit is contained in:
GuillaumeSD
2024-12-29 18:41:42 +01:00
parent a2a1c826b9
commit 3bf246beec
2 changed files with 3 additions and 6 deletions

View File

@@ -52,11 +52,8 @@ export const getLichessEval = async (
bestMove,
lines: linesToKeep,
};
} catch (rawError) {
const error =
rawError instanceof Error ? rawError : new Error("Unknown error");
if (error.name !== "AbortError") {
} catch (error) {
if (error !== "timeout") {
logErrorToSentry(error, { fen, multiPv });
}

View File

@@ -4,7 +4,7 @@ export const isSentryEnabled = () =>
!!process.env.NEXT_PUBLIC_SENTRY_DSN && Sentry.isInitialized();
export const logErrorToSentry = (
error: Error,
error: unknown,
context?: Record<string, unknown>
) => {
if (isSentryEnabled()) {