catch exceptions and show them when validating email

This commit is contained in:
Evan Prodromou 2011-04-18 10:44:55 -04:00
parent dfbb4eaa89
commit 55ebddb5fd

View File

@ -211,13 +211,18 @@ class EmailregisterAction extends Action
$valid = false; $valid = false;
if (Event::handle('StartValidateUserEmail', array(null, $this->email, &$valid))) { try {
$valid = Validate::email($this->email, common_config('email', 'check_domain')); if (Event::handle('StartValidateUserEmail', array(null, $this->email, &$valid))) {
Event::handle('EndValidateUserEmail', array(null, $this->email, &$valid)); $valid = Validate::email($this->email, common_config('email', 'check_domain'));
} Event::handle('EndValidateUserEmail', array(null, $this->email, &$valid));
}
if (!$valid) { if (!$valid) {
$this->error = _('Not a valid email address.'); $this->error = _('Not a valid email address.');
$this->showRegistrationForm();
return;
}
} catch (ClientException $e) {
$this->error = $e->getMessage();
$this->showRegistrationForm(); $this->showRegistrationForm();
return; return;
} }