Confirm_address::getByAddress not getAddress

Also fixed the error handling to match the function call.
This commit is contained in:
Mikael Nordfeldth 2017-04-29 14:48:46 +02:00
parent 853b016a42
commit c505652c15

View File

@ -33,9 +33,10 @@ $ca = null;
if (have_option('e', 'email')) {
$email = get_option_value('e', 'email');
$ca = Confirm_address::getAddress($email, 'email');
if (!$ca instanceof Confirm_address) {
print "Can't find email $email in confirm_address table.\n";
try {
$ca = Confirm_address::getByAddress($email, 'email');
} catch (NoResultException $e) {
print sprintf("Can't find %s address %s in %s table.\n", $e->obj->address_type, $e->obj->address, $e->obj->tableName());
exit(1);
}
} elseif (have_option('a', 'all')) {