We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ba69077 commit fbe9c83Copy full SHA for fbe9c83
1 file changed
jest.setup.ts
@@ -28,10 +28,11 @@ global.rateCall = async function rateCall<T>(
28
const result = await fn();
29
30
// If the API returns 429, throw to trigger retry
31
- if ('status' in result && result.status === 429) {
+ if (result && typeof result === 'object' && 'status' in result && result.status === 429) {
32
throw { code: 3505, message: 'Service tier capacity exceeded' };
33
}
34
35
+
36
lastCall = Date.now();
37
return result;
38
} catch (err: any) {
0 commit comments