Confirm_address::getByAddress not getAddress
Also fixed the error handling to match the function call.
This commit is contained in:
parent
853b016a42
commit
c505652c15
|
@ -33,9 +33,10 @@ $ca = null;
|
||||||
|
|
||||||
if (have_option('e', 'email')) {
|
if (have_option('e', 'email')) {
|
||||||
$email = get_option_value('e', 'email');
|
$email = get_option_value('e', 'email');
|
||||||
$ca = Confirm_address::getAddress($email, 'email');
|
try {
|
||||||
if (!$ca instanceof Confirm_address) {
|
$ca = Confirm_address::getByAddress($email, 'email');
|
||||||
print "Can't find email $email in confirm_address table.\n";
|
} 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);
|
exit(1);
|
||||||
}
|
}
|
||||||
} elseif (have_option('a', 'all')) {
|
} elseif (have_option('a', 'all')) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user