Add catching exception and add logging

Catch IOException and MetafactureException and log the filename of the file which causes the trouble. Comes in handy when processing many files and only some few files are corrupt.