Skip to content

Commit

Permalink
fix: error reporting from #27
Browse files Browse the repository at this point in the history
  • Loading branch information
odinuv committed May 14, 2018
1 parent 3263de8 commit eb77f51
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/CsvFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,8 @@ public function writeRow(array $row)
if (($ret === false) || (($ret === 0) && (strlen($str) > 0))) {
throw new Exception(
"Cannot write to CSV file " . $this->getPathname() .
' Error: ' . error_get_last()['message'] . ' Return: ' . json_encode($ret) .
($ret === false && error_get_last() ? 'Error: ' . error_get_last()['message'] : '') .
' Return: ' . json_encode($ret) .
' To write: ' . strlen($str) . ' Written: ' . $ret,
Exception::WRITE_ERROR,
null,
Expand Down
1 change: 1 addition & 0 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php

ini_set('display_errors', true);
error_reporting(-1);

require_once __DIR__ . '/../vendor/autoload.php';

0 comments on commit eb77f51

Please sign in to comment.