Skip to content

Commit

Permalink
Build error message once.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Feb 22, 2017
1 parent 78bbe2d commit de4d96f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,11 @@ public function configSpecialValues($what)
*/
public function removeUserData($user)
{
$err = sprintf(
_("There was an error removing an address book for %s"),
$user
);

/* We need a clean copy of the $cfgSources array here.*/
$cfgSources = Turba::availableSources();
foreach ($cfgSources as $sourceId => $source) {
Expand All @@ -363,7 +368,7 @@ public function removeUserData($user)
continue;
} catch (Turba_Exception $e) {
Horde::log($e, 'ERR');
throw new Turba_Exception(sprintf(_("There was an error removing an address book for %s"), $user));
throw new Turba_Exception($err);
}
}
}
Expand Down Expand Up @@ -395,7 +400,7 @@ public function removeUserData($user)
continue;
} catch (Turba_Exception $e) {
Horde::log($e, 'ERR');
throw new Turba_Exception(sprintf(_("There was an error removing an address book for %s"), $user));
throw new Turba_Exception($err);
}
}

Expand All @@ -408,7 +413,7 @@ public function removeUserData($user)
}
} catch (Horde_Share_Exception $e) {
Horde::log($e, 'ERR');
throw new Turba_Exception(sprintf(_("There was an error removing an address book for %s"), $user));
throw new Turba_Exception($err);
}
}

Expand Down

0 comments on commit de4d96f

Please sign in to comment.