identifyFileFormat: improve error messaging