do not retry SyntaxErrors

This commit is contained in:
Hazelnoot 2025-03-03 01:36:33 -05:00
parent 7a2abb1bf5
commit fd41332a85

View file

@ -18,6 +18,7 @@ export function isRetryableError(e: unknown): boolean {
if (e instanceof UnrecoverableError) return false; if (e instanceof UnrecoverableError) return false;
if (e instanceof AbortError) return true; if (e instanceof AbortError) return true;
if (e instanceof FetchError) return true; if (e instanceof FetchError) return true;
if (e instanceof SyntaxError) return false;
if (e instanceof Error) return e.name === 'AbortError'; if (e instanceof Error) return e.name === 'AbortError';
return true; return true;
} }