mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 12:25:02 +00:00
debug(phisherman): gracefully handle and log unexpected API responses
This commit is contained in:
parent
c5b2812452
commit
ecd9a5863c
1 changed files with 5 additions and 0 deletions
|
@ -130,6 +130,11 @@ async function fetchDomainInfo(domain: string): Promise<PhishermanDomainInfo | n
|
||||||
console.log(`[PHISHERMAN] Requesting domain information: ${domain}`);
|
console.log(`[PHISHERMAN] Requesting domain information: ${domain}`);
|
||||||
const result = await apiCall<Record<string, DomainInfoApiCallResult>>("GET", `/v2/domains/info/${domain}`);
|
const result = await apiCall<Record<string, DomainInfoApiCallResult>>("GET", `/v2/domains/info/${domain}`);
|
||||||
const domainInfo = result[domain];
|
const domainInfo = result[domain];
|
||||||
|
if (!domainInfo) {
|
||||||
|
// tslint:disable-next-line:no-console
|
||||||
|
console.warn("Unexpected Phisherman API response:", result);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
if (domainInfo.classification === "unknown") {
|
if (domainInfo.classification === "unknown") {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue