@riavzon/bot-detector 1.0.10 → 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.mjs CHANGED
@@ -498,7 +498,7 @@ async function updateBannedIP(cookie, ipAddress, country, user_agent, info) {
498
498
  reason = ${ex("reason")}`).run(...params);
499
499
  log.info(`Updated Database TABLE - banned. A user has been banned for IP ${ipAddress} (score ${String(info.score)})`);
500
500
  } catch (err) {
501
- log.error({ error: err }, "ERROR UPDATING \"banned\" TABLE");
501
+ log.error({ err }, "ERROR UPDATING \"banned\" TABLE");
502
502
  throw err;
503
503
  }
504
504
  }
@@ -516,7 +516,7 @@ async function updateIsBot(isBot, cookie) {
516
516
  try {
517
517
  await prep(db, `UPDATE visitors SET is_bot = ? WHERE canary_id = ?`).run(...params);
518
518
  } catch (err) {
519
- log.error({ error: err }, "ERROR UPDATING IS_BOT");
519
+ log.error({ err }, "ERROR UPDATING IS_BOT");
520
520
  throw err;
521
521
  }
522
522
  }
@@ -629,7 +629,7 @@ async function updateVisitor(u) {
629
629
  log.info(`Updated visitors table, Visitor row for canary_id=${cookie ?? ""} inserted/updated successfully.`);
630
630
  return;
631
631
  } catch (err) {
632
- log.error({ error: err }, `ERROR UPDATING visitors TABLE`);
632
+ log.error({ err }, `ERROR UPDATING visitors TABLE`);
633
633
  }
634
634
  }
635
635
 
@@ -646,7 +646,7 @@ async function updateScore(score, cookie) {
646
646
  try {
647
647
  await prep(db, `UPDATE visitors SET suspicious_activity_score = ? WHERE canary_id = ?`).run(...params);
648
648
  } catch (err) {
649
- log.error({ error: err }, "ERROR UPDATING SCORE");
649
+ log.error({ err }, "ERROR UPDATING SCORE");
650
650
  throw err;
651
651
  }
652
652
  }