crawlforge-mcp-server 4.2.7 → 4.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "crawlforge-mcp-server",
3
- "version": "4.2.7",
3
+ "version": "4.2.8",
4
4
  "description": "CrawlForge MCP Server - Professional Model Context Protocol server with 23 web scraping, crawling, and content processing tools. Defaults to local Ollama for LLM extraction (no API key needed); OpenAI/Anthropic available as opt-in. v4.0 adds Markdown-first output, pre-built site templates, Camoufox stealth engine, and cost transparency.",
5
5
  "main": "server.js",
6
6
  "bin": {
@@ -391,8 +391,9 @@ export class Logger {
391
391
 
392
392
  this.winston.error(message, errorContext);
393
393
 
394
- // Track error for analysis
395
- if (this.enableErrorTracking) {
394
+ // Track error for analysis (only when an Error object was actually passed —
395
+ // logger.error(message) with no error must not reach trackError's error.name).
396
+ if (this.enableErrorTracking && error) {
396
397
  this.trackError(error, context, requestId);
397
398
  }
398
399
  }
@@ -425,11 +426,13 @@ export class Logger {
425
426
  trackError(error, context, requestId) {
426
427
  // Could be extended to send to error tracking service
427
428
  // For now, just log structured error data
429
+ // Null-safe: a shared logger must never throw, even if called with a
430
+ // non-Error (or null) value.
428
431
  this.winston.error('Error tracking', {
429
432
  errorTracking: {
430
- type: error.name,
431
- message: error.message,
432
- stack: error.stack,
433
+ type: error?.name ?? 'UnknownError',
434
+ message: error?.message ?? String(error ?? ''),
435
+ stack: error?.stack,
433
436
  context,
434
437
  requestId,
435
438
  timestamp: new Date().toISOString()