Skip to content

Commit dd49f84

Browse files
committed
Give more info when deletion fails
1 parent c754349 commit dd49f84

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/midcom/baseclasses/core/dbobject.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ public static function delete(midcom_core_dbaobject $object) : bool
290290
if (!$object instanceof midcom_db_attachment) {
291291
foreach ($object->list_attachments() as $attachment) {
292292
if (!$attachment->delete()) {
293-
debug_add("Failed to delete attachment ID {$attachment->id}", MIDCOM_LOG_ERROR);
293+
debug_add("Failed to delete attachment ID {$attachment->id}: " . midcom_connection::get_error_string(), MIDCOM_LOG_ERROR);
294294
return false;
295295
}
296296
}
@@ -300,7 +300,7 @@ public static function delete(midcom_core_dbaobject $object) : bool
300300
$query->add_constraint('parentguid', '=', $object->guid);
301301
foreach ($query->execute() as $parameter) {
302302
if (!$parameter->delete()) {
303-
debug_add("Failed to delete parameter ID {$parameter->id}", MIDCOM_LOG_ERROR);
303+
debug_add("Failed to delete parameter ID {$parameter->id}: " . midcom_connection::get_error_string(), MIDCOM_LOG_ERROR);
304304
return false;
305305
}
306306
}

0 commit comments

Comments
 (0)