console.log(`> ${chalk.bold(chalk.underline(alias))} is a custom domain.`);
console.log(`> Verifying that ${chalk.bold(chalk.underline(alias))} has a ${chalk.dim('`CNAME`')} or ${chalk.dim('`ALIAS`')} record pointing to ${chalk.bold(chalk.underline('alias.zeit.co'))}.`);
console.log(`${chalk.cyan('> Success!')} Deployment ${chalk.bold(`https://${depl.url}`)}${chalk.dim(`(${depl.uid})`)} now points to ${chalk.bold(chalk.underline(`https://${alias}`))}`);
consterr=newError(`You are attempting to use a custom domain alias (${chalk.underline(chalk.cyan(alias))}), but this is only enabled for premium accounts. Please upgrade at ${chalk.underline('https://zeit.co/account')}`);
err.userError=true;
returnbail(err);
}
if('alias_in_use'===code){
consterr=newError(`The alias you are trying to configure (${chalk.underline(chalk.cyan(alias))}) is already in use by a different account.`);
err.userError=true;
returnbail(err);
}
returnbail(newError('Authorization error'));
}
// all other errors
if(body.error){
constcode=body.error.code;
if('deployment_not_found'===code){
returnbail(newError('Deployment not found'));
}
if('cert_missing'===code){
console.log(`> Provisioning certificate for ${chalk.underline(chalk.cyan(alias))}`);
awaitthis.createCert();
// try again, but now having provisioned the certificate
returnthis.createAlias(depl,alias);
}
returnbail(newError(body.error.message));
}
// the two expected succesful cods are 200 and 304
consterr=newError(`The domain ${domain} has an A record ${chalk.bold(ip)} that doesn\'t resolve to ${chalk.bold(chalk.underline('alias.zeit.co'))}. Please check your DNS settings.`);
consterr=newError(`We couldn't verify ownership of the domain ${domain}. Make sure the appropriate \`ALIAS\` or \`CNAME\` records are configured and pointing to ${chalk.bold('alias.zeit.co')}.`);