BaseLLM: don't disguise AbortError when rethrowing

When we catch/log/rethrow AbortError, throw it as itself, rather than
throw Error(e.message) so that outer callers can detect it by the
exception name.
This commit is contained in:
Owen W. Taylor 2025-02-11 23:11:20 -05:00
parent 8acc20ab3e
commit 5166e74799

View file

@ -460,11 +460,7 @@ export abstract class BaseLLM implements ILLM {
throw new Error(message);
}
}
//if e instance of LLMError, rethrow
if (e instanceof LLMError) {
throw e;
}
throw new Error(e.message);
throw e;
}
};
return withExponentialBackoff<Response>(