Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.catch(async (e) => {
if (e.status !== 404) {
throw e;
}
Logger.debug('No favourite vhost defined for ' + appId + ', selecting the best one');
const allDomains = await getAllDomains({ id: orgaId, appId }).then(sendToApi);
const result = selectBest(allDomains);
if (result == null) {
throw new Error(`Couldn't find a domain name`);
}
return result;
});
}