import error handling of whois

This commit is contained in:
HF 2022-08-01 23:18:16 +02:00
parent 50e4845d94
commit 6765de5936

View File

@ -116,12 +116,16 @@ async function dummy() {
} }
async function saveIPInfo(ip, isProxy, info) { async function saveIPInfo(ip, isProxy, info) {
try {
const whoisData = await whois(ip); const whoisData = await whois(ip);
IPInfo.upsert({ IPInfo.upsert({
...whoisData, ...whoisData,
isProxy, isProxy,
pcheck: info, pcheck: info,
}); });
} catch (error) {
logger.error(`Error whois for ${ip}: ${error.message}`);
}
} }
/* /*