Throw error if file type is unknown