MarcusBarnes / mik

The Move to Islandora Kit is an extensible PHP command-line tool for converting source content and metadata into packages suitable for importing into Islandora (or other digital repository and preservations systems).
GNU General Public License v3.0
34 stars 11 forks source link

Error puked out when we should provide a useful message #458

Open mjordan opened 6 years ago

mjordan commented 6 years ago

When MIK can't find the input CSV file, it pukes something like this out to the user:

Fatal error: Uncaught exception 'RuntimeException' with message 'SplFileObject::__construct(M:\Le Soleil\Missing issues from VPL\Missing issues from VPL_Le Soleil
 de Colombie): failed to open stream: No such file or directory' in M:\mik_mark\vendor\league\csv\src\AbstractCsv.php:128
Stack trace:
#0 M:\mik_mark\vendor\league\csv\src\AbstractCsv.php(128): SplFileObject->__construct('M:\\Le Soleil\\Mi...', 'r+')
#1 M:\mik_mark\vendor\league\csv\src\Reader.php(263): League\Csv\AbstractCsv->getIterator()
#2 M:\mik_mark\vendor\league\csv\src\Reader.php(217): League\Csv\Reader->getRow(0)
#3 M:\mik_mark\vendor\league\csv\src\Reader.php(184): League\Csv\Reader->getAssocKeys(0)
#4 M:\mik_mark\src\fetchers\Csv.php(91): League\Csv\Reader->fetchAssoc()
#5 M:\mik_mark\src\fetchers\Csv.php(128): mik\fetchers\Csv->getRecords()
#6 M:\mik_mark\mik(131): mik\fetchers\Csv->getNumRecs()
#7 {main}
  thrown in M:\mik_mark\vendor\league\csv\src\AbstractCsv.php on line 128

How scary! We should provide a useful message saying something like "Can't find input CSV file specified in the [FETCHER] section of your configuration file."