tweak: more retry cases
This commit is contained in:
parent
606cf3b6f2
commit
ecc5050838
1 changed files with 3 additions and 2 deletions
|
|
@ -65,7 +65,7 @@ export namespace SessionRetry {
|
||||||
if (json.type === "error" && json.error?.type === "too_many_requests") {
|
if (json.type === "error" && json.error?.type === "too_many_requests") {
|
||||||
return "Too Many Requests"
|
return "Too Many Requests"
|
||||||
}
|
}
|
||||||
if (json.code === "Some resource has been exhausted") {
|
if (json.code.includes("exhausted") || json.code.includes("unavailable")) {
|
||||||
return "Provider is overloaded"
|
return "Provider is overloaded"
|
||||||
}
|
}
|
||||||
if (json.type === "error" && json.error?.code?.includes("rate_limit")) {
|
if (json.type === "error" && json.error?.code?.includes("rate_limit")) {
|
||||||
|
|
@ -73,7 +73,8 @@ export namespace SessionRetry {
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
json.error?.message?.includes("no_kv_space") ||
|
json.error?.message?.includes("no_kv_space") ||
|
||||||
(json.type === "error" && json.error?.type === "server_error")
|
(json.type === "error" && json.error?.type === "server_error") ||
|
||||||
|
!!json.error
|
||||||
) {
|
) {
|
||||||
return "Provider Server Error"
|
return "Provider Server Error"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue