Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/internal/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,7 @@ function integerOrUndefined(value: unknown): number | undefined {
/** Whether a `fetch` failure happened while connecting, before the request was sent. */
function failedBeforeSend(error: unknown): boolean {
const cause = (error as { cause?: unknown } | null)?.cause as
| { code?: unknown; errors?: unknown }
| undefined;
{ code?: unknown; errors?: unknown } | undefined;
if (!cause) return false;
if (typeof cause.code === "string") return NOT_SENT_CODES.has(cause.code);
// Happy-eyeballs connects fail with an AggregateError of one error per address.
Expand Down
9 changes: 1 addition & 8 deletions src/internal/exceptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,7 @@ export class ValidationError extends ScrapeBadgerError {

/** Why the Web Scraping API reported a target as blocked (SCR-306). */
export type BlockKind =
| "antibot"
| "captcha"
| "rate_limit"
| "ip_ban"
| "geo_block"
| "auth_wall"
| "empty"
| "other";
"antibot" | "captcha" | "rate_limit" | "ip_ban" | "geo_block" | "auth_wall" | "empty" | "other";

/** The CAPTCHA gating a blocked page. */
export interface BlockingCaptcha {
Expand Down
Loading
Loading