@riavzon/bot-detector 1.0.11 → 1.0.12

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/dist/main.cjs CHANGED
@@ -508,7 +508,7 @@ async function updateBannedIP(cookie, ipAddress, country, user_agent, info) {
508
508
  reason = ${ex("reason")}`).run(...params);
509
509
  log.info(`Updated Database TABLE - banned. A user has been banned for IP ${ipAddress} (score ${String(info.score)})`);
510
510
  } catch (err) {
511
- log.error({ error: err }, "ERROR UPDATING \"banned\" TABLE");
511
+ log.error({ err }, "ERROR UPDATING \"banned\" TABLE");
512
512
  throw err;
513
513
  }
514
514
  }
@@ -526,7 +526,7 @@ async function updateIsBot(isBot, cookie) {
526
526
  try {
527
527
  await prep(db, `UPDATE visitors SET is_bot = ? WHERE canary_id = ?`).run(...params);
528
528
  } catch (err) {
529
- log.error({ error: err }, "ERROR UPDATING IS_BOT");
529
+ log.error({ err }, "ERROR UPDATING IS_BOT");
530
530
  throw err;
531
531
  }
532
532
  }
@@ -639,7 +639,7 @@ async function updateVisitor(u) {
639
639
  log.info(`Updated visitors table, Visitor row for canary_id=${cookie ?? ""} inserted/updated successfully.`);
640
640
  return;
641
641
  } catch (err) {
642
- log.error({ error: err }, `ERROR UPDATING visitors TABLE`);
642
+ log.error({ err }, `ERROR UPDATING visitors TABLE`);
643
643
  }
644
644
  }
645
645
 
@@ -656,7 +656,7 @@ async function updateScore(score, cookie) {
656
656
  try {
657
657
  await prep(db, `UPDATE visitors SET suspicious_activity_score = ? WHERE canary_id = ?`).run(...params);
658
658
  } catch (err) {
659
- log.error({ error: err }, "ERROR UPDATING SCORE");
659
+ log.error({ err }, "ERROR UPDATING SCORE");
660
660
  throw err;
661
661
  }
662
662
  }