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) {
const whoisData = await whois(ip); try {
IPInfo.upsert({ const whoisData = await whois(ip);
...whoisData, IPInfo.upsert({
isProxy, ...whoisData,
pcheck: info, isProxy,
}); pcheck: info,
});
} catch (error) {
logger.error(`Error whois for ${ip}: ${error.message}`);
}
} }
/* /*