_validate_fields_for_unparse: more info in UnexpectedValueException

This commit is contained in:
Fonata
2018-03-17 10:31:25 +01:00
parent 49728a74bb
commit 7498a963ac

View File

@@ -857,7 +857,10 @@ class Csv {
// original titles are not given in fields. that is okay if count is okay.
if (count($fields) != count($titlesOnParse)) {
throw new \UnexpectedValueException('The specified fields do not match any titles and do not match column count.');
throw new \UnexpectedValueException(
"The specified fields do not match any titles and do not match column count.\n" .
"\$fields was " . print_r($fields, true) .
"\$titlesOnParse was " . print_r($titlesOnParse, true));
}
return array_combine($titlesOnParse, $fields);