Skip to content

Commit

Permalink
Catch SourceNotFound error for domains transfer-in (#1879)
Browse files Browse the repository at this point in the history
  • Loading branch information
mglagola authored and javivelasco committed Feb 6, 2019
1 parent 5999ec7 commit 72142c3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/commands/domains/transfer-in.ts
Expand Up @@ -116,6 +116,13 @@ export default async function transferIn(
return 1;
}

if (transferInResult instanceof ERRORS.SourceNotFound) {
output.error(
`Could not purchase domain. Please add a payment method using ${cmd('now billing add')}.`
);
return 1;
}

console.log(`${chalk.cyan('> Success!')} Domain ${param(domainName)} transfer started ${transferStamp()}`);
output.print(` To finalize the transfer, we are waiting for approval from your current registrar.\n`);
output.print(` You will receive an email upon completion.\n`);
Expand Down
3 changes: 3 additions & 0 deletions src/util/domains/transfer-in-domain.ts
Expand Up @@ -30,6 +30,9 @@ export default async function transferInDomain(
if (error.code === 'invalid_auth_code') {
return new ERRORS.InvalidTransferAuthCode(name, authCode);
}
if (error.code === 'source_not_found') {
return new ERRORS.SourceNotFound();
}
throw error;
}
}

0 comments on commit 72142c3

Please sign in to comment.