- $confirm = $this->getConfirmation($transport);
-
- if (!$confirm) {
- // TRANS: Message given canceling IM address confirmation that is not pending.
- $this->showForm(_('No pending confirmation to cancel.'));
- return;
- }
- if ($confirm->address != $screenname) {
- // TRANS: Message given canceling IM address confirmation for the wrong IM address.
- $this->showForm(_('That is the wrong IM address.'));
- return;
+ try {
+ $confirm = $this->getConfirmation($transport);
+ if ($confirm->address != $screenname) {
+ // TRANS: Message given canceling IM address confirmation for the wrong IM address.
+ throw new ClientException(_('That is the wrong IM address.'));
+ }
+ } catch (NoResultException $e) {
+ // TRANS: Message given canceling Instant Messaging address confirmation that is not pending.
+ throw new AlreadyFulfilledException(_('No pending confirmation to cancel.'));