Whatever was thrown or rejected with
true for an HttpError with status 429
isRateLimited(new HttpError(429, 'Too Many Requests')); // true
isRateLimited(new HttpError(403, 'Forbidden')); // false
isRateLimited(new Error('HTTP Error: 429')); // false (not an HttpError)
export function isRateLimited(error: unknown): boolean {
return error instanceof HttpError && error.status === HttpStatus.TOO_MANY_REQUESTS;
}
True when a supplier answered
429 Too Many Requests. That is the supplier throttling us, not a bug here, so callers log it atwarninstead oferror.