diff --git a/backend/src/plugins/Phisherman/functions/getDomainInfo.ts b/backend/src/plugins/Phisherman/functions/getDomainInfo.ts index d5b9cbf3..8f61bd41 100644 --- a/backend/src/plugins/Phisherman/functions/getDomainInfo.ts +++ b/backend/src/plugins/Phisherman/functions/getDomainInfo.ts @@ -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); }