A better error message would be: An error occurred while reading filename.