Spaces:
Paused
Paused
File size: 2,180 Bytes
0e759d2 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
import { EngineResultsTracker, Meta } from ".";
import { Engine, FeatureFlag } from "./engines";
export class EngineError extends Error {
constructor(message?: string, options?: ErrorOptions) {
super(message, options);
}
}
export class TimeoutError extends Error {
constructor(message?: string, options?: ErrorOptions) {
super(message, options);
}
}
export class NoEnginesLeftError extends Error {
public fallbackList: Engine[];
public results: EngineResultsTracker;
constructor(fallbackList: Engine[], results: EngineResultsTracker) {
super(
"All scraping engines failed! -- Double check the URL to make sure it's not broken. If the issue persists, contact us at help@firecrawl.com.",
);
this.fallbackList = fallbackList;
this.results = results;
}
}
export class AddFeatureError extends Error {
public featureFlags: FeatureFlag[];
public pdfPrefetch: Meta["pdfPrefetch"];
constructor(featureFlags: FeatureFlag[], pdfPrefetch?: Meta["pdfPrefetch"]) {
super("New feature flags have been discovered: " + featureFlags.join(", "));
this.featureFlags = featureFlags;
this.pdfPrefetch = pdfPrefetch;
}
}
export class RemoveFeatureError extends Error {
public featureFlags: FeatureFlag[];
constructor(featureFlags: FeatureFlag[]) {
super(
"Incorrect feature flags have been discovered: " +
featureFlags.join(", "),
);
this.featureFlags = featureFlags;
}
}
export class SiteError extends Error {
public code: string;
constructor(code: string) {
super(
"Specified URL is failing to load in the browser. Error code: " + code,
);
this.code = code;
}
}
export class ActionError extends Error {
public code: string;
constructor(code: string) {
super("Action(s) failed to complete. Error code: " + code);
this.code = code;
}
}
export class UnsupportedFileError extends Error {
public reason: string;
constructor(reason: string) {
super("Scrape resulted in unsupported file: " + reason);
this.reason = reason;
}
}
export class PDFAntibotError extends Error {
constructor() {
super("PDF scrape was prevented by anti-bot")
}
}
|