fix : lichess timeout errors handling
This commit is contained in:
@@ -52,11 +52,8 @@ export const getLichessEval = async (
|
|||||||
bestMove,
|
bestMove,
|
||||||
lines: linesToKeep,
|
lines: linesToKeep,
|
||||||
};
|
};
|
||||||
} catch (rawError) {
|
} catch (error) {
|
||||||
const error =
|
if (error !== "timeout") {
|
||||||
rawError instanceof Error ? rawError : new Error("Unknown error");
|
|
||||||
|
|
||||||
if (error.name !== "AbortError") {
|
|
||||||
logErrorToSentry(error, { fen, multiPv });
|
logErrorToSentry(error, { fen, multiPv });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ export const isSentryEnabled = () =>
|
|||||||
!!process.env.NEXT_PUBLIC_SENTRY_DSN && Sentry.isInitialized();
|
!!process.env.NEXT_PUBLIC_SENTRY_DSN && Sentry.isInitialized();
|
||||||
|
|
||||||
export const logErrorToSentry = (
|
export const logErrorToSentry = (
|
||||||
error: Error,
|
error: unknown,
|
||||||
context?: Record<string, unknown>
|
context?: Record<string, unknown>
|
||||||
) => {
|
) => {
|
||||||
if (isSentryEnabled()) {
|
if (isSentryEnabled()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user