Throw error on bad file