CODAIT / magicat

🧙😺 magicat - Deep learning magic.. with the convenience of cat!
Apache License 2.0
26 stars 5 forks source link

more descriptive error messages #7

Closed kastentx closed 4 years ago

kastentx commented 5 years ago

This adds the 'offending' filename to error output for dir scans, along with a general refactor of the error message contents.

With these changes, if a scan is run on a directory containing a corrupt image file, like in the example given in the open issue, the output is

Scanning directory '/Users/nick/Code/MY_FORKS/magicat-1/sample-images'...

Error encountered with 'broken.jpg' while scanning 'sample-images/' - Image pre-processing Error: Could not find MIME for Buffer <null>

Running the tool on that file directly:

Error processing 'sample-images/broken.jpg' - Image pre-processing Error: Could not find MIME for Buffer <null>

Fixes #5

kastentx commented 5 years ago

I didn't see that these had been approved before losing write access 😿

If anyone wants to merge and republish to npm it should be all good to go, and pretty straightforward.

vabarbosa commented 4 years ago

somehow 🤷 this got lost/dropped. i am closing as a recent refactor/update addressed similar issue.