Altering error message to show the exception

This commit is contained in:
Chris Lock 2016-12-13 14:28:57 +00:00 committed by Daniel Hensby
parent 7ca876a4c7
commit 11bc05de96
No known key found for this signature in database
GPG Key ID: B00D1E9767F0B06E

View File

@ -81,7 +81,11 @@ class CsvBulkLoader extends BulkLoader {
@unlink($file);
}
} catch (Exception $e) {
print "Failed to parse {$last}\n";
$failedMessage = sprintf("Failed to parse %s", $last);
if (Director::isDev()) {
$failedMessage = sprintf($failedMessage . " because %s", $e->getMessage());
}
print $failedMessage . PHP_EOL;
}
return $result;