fix: preserve ebay rate-limit fallback
This commit is contained in:
@@ -9,7 +9,7 @@ import {
|
||||
ensureCookies,
|
||||
formatCookiesForHeader,
|
||||
} from "../utils/cookies";
|
||||
import { fetchHtml, HttpError } from "../utils/http";
|
||||
import { fetchHtml, HttpError, RateLimitError } from "../utils/http";
|
||||
import { logger } from "../utils/logger";
|
||||
import { classifyUnstableListings } from "../utils/unstable";
|
||||
|
||||
@@ -511,9 +511,9 @@ export default async function fetchEbayItems(
|
||||
logger.log(`Parsed ${filteredListings.length} eBay listings.`);
|
||||
return finalizeResults(filteredListings);
|
||||
} catch (err) {
|
||||
if (err instanceof HttpError) {
|
||||
if (err instanceof HttpError || err instanceof RateLimitError) {
|
||||
logger.warn(
|
||||
`Failed to fetch eBay search (${err.statusCode}): ${err.message}`,
|
||||
`Failed to fetch eBay search (${err instanceof HttpError ? err.statusCode : 429}): ${err.message}`,
|
||||
);
|
||||
return finalizeResults([]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user