Import: Improve exception info during storing rows

This commit is contained in:
Markus Frosch 2018-12-14 09:58:55 +01:00
parent 35318396e8
commit 58c0689005

View File

@ -301,6 +301,7 @@ class Import
} }
foreach ($newRows as $row) { foreach ($newRows as $row) {
try {
$db->insert('imported_row', $rows[$row]); $db->insert('imported_row', $rows[$row]);
foreach ($this->rowProperties[$row] as $property) { foreach ($this->rowProperties[$row] as $property) {
$db->insert('imported_row_property', array( $db->insert('imported_row_property', array(
@ -308,6 +309,13 @@ class Import
'property_checksum' => $property 'property_checksum' => $property
)); ));
} }
} catch (Exception $e) {
throw new IcingaException(
"Error while storing a row for '%s' into database: %s",
$rows[$row]['object_name'],
$e->getMessage()
);
}
} }
foreach (array_keys($rows) as $row) { foreach (array_keys($rows) as $row) {