Browse Source

Merge remote-tracking branch 'origin/master' into omos/pr-652-merge

Alvin Unreal 1 month ago
parent
commit
a41c649006

+ 4 - 0
src/hooks/foreground-fallback/index.test.ts

@@ -89,6 +89,10 @@ describe('isRateLimitError', () => {
     expect(isRateLimitError({ message: 'Insufficient balance.' })).toBe(true);
   });
 
+  test('returns true for "Service Unavailable"', () => {
+    expect(isRateLimitError({ message: 'Service Unavailable' })).toBe(true);
+  });
+
   test('returns true for "Monthly usage limit reached"', () => {
     expect(
       isRateLimitError({

+ 3 - 0
src/hooks/foreground-fallback/index.ts

@@ -43,6 +43,9 @@ const RATE_LIMIT_PATTERNS = [
   /insufficient.?(quota|balance)/i,
   /high concurrency/i,
   /reduce concurrency/i,
+  // ponytail: transient server errors mixed in; rename to isRetryableError
+  // and split from rate-limit detection when this list grows further
+  /service unavailable/i,
   /monthly usage limit/i,
   /5-hour usage limit/i,
   /weekly usage limit/i,