fix(phisherman): reset validApiKey on 'missing permissions' error; log getDomainInfo() errors
This commit is contained in:
parent
fe7872888b
commit
1d5d8d96de
1 changed files with 8 additions and 1 deletions
|
@ -11,7 +11,14 @@ export async function getDomainInfo(
|
|||
return null;
|
||||
}
|
||||
|
||||
const info = await getPhishermanDomainInfo(domain).catch(() => null);
|
||||
const info = await getPhishermanDomainInfo(domain).catch((err) => {
|
||||
// tslint:disable-next-line:no-console
|
||||
console.warn(`[PHISHERMAN] Error in getDomainInfo() for server ${pluginData.guild.id}: ${err.message}`);
|
||||
if (err.message === "missing permissions") {
|
||||
pluginData.state.validApiKey = null;
|
||||
}
|
||||
return null;
|
||||
});
|
||||
if (info != null && !phishermanDomainIsSafe(info)) {
|
||||
trackPhishermanCaughtDomain(pluginData.state.validApiKey, domain);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue