Crawlee—A web scraping and browser automation library for Node.js to build reliable crawlers. In JavaScript and TypeScript. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, and other files from websites. Works with Puppeteer, Playwright, Cheerio, JSDOM, and raw HTTP. Both headful and headless mode. With proxy rotation.
TypeScript apifyautomationcrawlercrawlingheadlessheadless-chromejavascriptnodejsnpmplaywrightpuppeteerscraperscrapingtypescriptweb-crawlerweb-crawlingweb-scraping
fix: improve ServiceConflictError message readability (#3480)
Richard Solar6456a648ba9a
diff --git a/packages/core/src/errors.ts b/packages/core/src/errors.tsindex 1acee0887..36b4b6549 100644--- a/packages/core/src/errors.ts+++ b/packages/core/src/errors.ts@@ -91,9 +91,16 @@ export class RequestHandlerError extends Error {*/export class ServiceConflictError extends Error {constructor(serviceName: string, newValue: unknown, existingValue: unknown) {+ const describe = (value: unknown): string => {+ if (typeof value === 'object' && value !== null) {+ return value.constructor.name;+ }+ return String(value);+ };+super(`Service ${serviceName} is already in use. ` +- `Existing value: ${existingValue}, attempted new value: ${newValue}.`,+ `Existing value: ${describe(existingValue)}, attempted new value: ${describe(newValue)}.`,);}}