mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 12:25:02 +00:00
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;
|
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)) {
|
if (info != null && !phishermanDomainIsSafe(info)) {
|
||||||
trackPhishermanCaughtDomain(pluginData.state.validApiKey, domain);
|
trackPhishermanCaughtDomain(pluginData.state.validApiKey, domain);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue