Improved error message when encountering unsupported file types

Fixes #269.