Add new exception to be thrown when parsing CSV files fails
This commit is contained in:
parent
f281f9b293
commit
cc0cf5b923
19
exceptions/generic/MDInvalidCsv.php
Normal file
19
exceptions/generic/MDInvalidCsv.php
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
<?PHP
|
||||||
|
declare(strict_types = 1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Exception to be thrown if parsing a CSV file is impossible (usually errors in
|
||||||
|
* trying to get table headings).
|
||||||
|
*/
|
||||||
|
final class MDInvalidCsv extends Exception {
|
||||||
|
/**
|
||||||
|
* Error message.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function errorMessage() {
|
||||||
|
//error message
|
||||||
|
return 'Invalid input CSV: ' . $e->getMessage();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user