Merge pull request #6391 from catharsisjelly/3.4-improving-csvbulk-error-message

Altering error message to show the exception
This commit is contained in:
Ingo Schommer 2017-01-19 14:00:07 +13:00 committed by GitHub
commit 61201edf81

View File

@ -81,7 +81,11 @@ class CsvBulkLoader extends BulkLoader {
@unlink($file); @unlink($file);
} }
} catch (Exception $e) { } 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; return $result;