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:
parent
8acc20ab3e
commit
5166e74799
1 changed files with 1 additions and 5 deletions
|
|
@ -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>(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue