summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--program/steps/addressbook/delete.inc12
1 files changed, 11 insertions, 1 deletions
diff --git a/program/steps/addressbook/delete.inc b/program/steps/addressbook/delete.inc
index 3bb2ef500..b69d519ac 100644
--- a/program/steps/addressbook/delete.inc
+++ b/program/steps/addressbook/delete.inc
@@ -51,7 +51,17 @@ foreach ($cids as $source => $cid)
$deleted = !$plugin['abort'] ? $CONTACTS->delete($cid, $undo_time < 1) : $plugin['result'];
if (!$deleted) {
- $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'contactdelerror', 'error');
+ if ($plugin['message']) {
+ $error = $plugin['message'];
+ }
+ else if (($error = $CONTACTS->get_error()) && $error['message']) {
+ $error = $error['message'];
+ }
+ else {
+ $error = 'contactdelerror';
+ }
+
+ $OUTPUT->show_message($error, 'error');
$OUTPUT->command('list_contacts');
$OUTPUT->send();
}