mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
Better OpenRouter error handling
This commit is contained in:
parent
3860abf855
commit
d7266be3fe
2 changed files with 6 additions and 1 deletions
5
.changeset/tender-cycles-help.md
Normal file
5
.changeset/tender-cycles-help.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"roo-cline": patch
|
||||
---
|
||||
|
||||
Better OpenRouter error handling
|
||||
|
|
@ -1010,7 +1010,7 @@ export class Cline {
|
|||
} catch (error) {
|
||||
// note that this api_req_failed ask is unique in that we only present this option if the api hasn't streamed any content yet (ie it fails on the first chunk due), as it would allow them to hit a retry button. However if the api failed mid-stream, it could be in any arbitrary state where some tools may have executed, so that error is handled differently and requires cancelling the task entirely.
|
||||
if (alwaysApproveResubmit) {
|
||||
const errorMsg = error.message ?? "Unknown error"
|
||||
const errorMsg = error.error?.metadata?.raw ?? error.message ?? "Unknown error"
|
||||
const baseDelay = requestDelaySeconds || 5
|
||||
const exponentialDelay = Math.ceil(baseDelay * Math.pow(2, retryAttempt))
|
||||
// Wait for the greater of the exponential delay or the rate limit delay
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue